private int ProcessReadChunkedSize(StreamChunkBytes ReadByteBuffer) {
GlobalLog.Enter("ConnectStream#" + ValidationHelper.HashString(this) + "::ProcessReadChunkedSize");
// now get the chunk size.
int chunkSize;
int BytesRead = ChunkParse.GetChunkSize(ReadByteBuffer, out chunkSize);
if (BytesRead <= 0) {
GlobalLog.Leave("ConnectStream#" + ValidationHelper.HashString(this) + "::ProcessReadChunkedSize - error");
throw new IOException(SR.GetString(SR.net_io_readfailure, SR.GetString(SR.net_io_connectionclosed)));
}
// Now skip past and extensions and the CRLF.
BytesRead = ChunkParse.SkipPastCRLF(ReadByteBuffer);
if (BytesRead <= 0) {
GlobalLog.Leave("ConnectStream#" + ValidationHelper.HashString(this) + "::ProcessReadChunkedSize - error");
throw new IOException(SR.GetString(SR.net_io_readfailure, SR.GetString(SR.net_io_connectionclosed)));
}
GlobalLog.Leave("ConnectStream#" + ValidationHelper.HashString(this) + "::ProcessReadChunkedSize", chunkSize);
return chunkSize;
}