C#でグーグルメールの受信プログラムを書いています。
下記のプログラムを実行すると、データを末尾まで取得していないにもかかわらず、ループから抜ける事があります。
readByteCount == 0 のみをループの脱出条件にすると、Readで止まって(恐らくタイムアウト待ちになって)しまいます。
データを末尾まで確実に受取るにはどうすればよいのでしょう?

TcpClient client; // 接続処理、略
SslStream stream; // clientとの関連付け処理、略

byte[] command = Encoding.UTF8.GetBytes( ”__TAG__ FECTH ...略” );
stream.Write( command );

byte[] byteBuffer = new byte[ 256 ];
int offset = 0;

while ( true )
{
int readByteCount = stream.Read( byteBuffer, offset, byteBuffer.Length - offset );
offset += readByteCount;

if ( client.Available == 0 ||
readByteCount == 0 )
{
break;
}

if ( offset >= byteBuffer.Length )
{ // バッファの拡張処理 }

}