我正在使用
System.IO.Stream.Read(byte[] buffer, int offset, int count)
方法。是否有替代该方法的方式(或设置属性),使该方法不会返回,直到读取完所有的count(或到达流的末尾)?或者我应该像这样做:int n = 0, readCount = 0;
while ((n = myStream.Read(buffer, readCount, countToRead - readCount)) > 0)
readCount += n;