MemoryStream: ReadBlock |
Reads a specifiec number of bytes from the stream.
Public Function ReadBlock( ByRef Buffer ( ) As Byte, ByVal Offset As Long, ByVal Count As Long ) As Long
If Offset plus Count exceeds the end of Buffer then an exception will be thrown. If the current position in the stream is closer to the end than Count bytes, then only the remaining bytes will be read.
The stream must be open to read from it, otherwise an exception will be thrown.
After reading from the stream, the current position will advance the number of byte as returend.
Exception | Condition |
---|---|
ArgumentNullException | Buffer is uninitialized. |
ArgumentException | Offset subtracted from the Buffer length is less than Count. |
ArgumentOutOfRangeException | Offset or Count is negative. |
ObjectDisposedException | The current stream instance is closed. |