streamクラスについて聞きたいのですが、下記のようなコードで
最後の行のReadByte();でなぜか-1が帰ってきてストリームをよんでくれません。
なぜでしょう?宜しくお願いします。
const int size = 10;
byte[] bytes = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10};
int numBytes;
MemoryStream stream = new MemoryStream();
stream.Write( bytes , 0 , size );
numBytes = stream.ReadByte();