I use System.IO.Stream.Read(byte[] buffer, int offset, int count). Is there an alternative to this method (or a property to set) so that the method does not return until the entire number of samples has been read (or the end of the stream)? Or should I do something like this:
int n = 0, readCount = 0;
while ((n = myStream.Read(buffer, readCount, countToRead - readCount)) > 0)
readCount += n;
source
share