Reads exactly count bytes from stream.
public static byte[] ReadExactly(this Stream stream, int count)
parameter | description |
---|---|
stream | The stream to read from. |
count | The count of bytes to read. |
A new byte array containing the data read from the stream.
Reads exactly count bytes from stream into buffer, starting at the byte given by offset.
public static void ReadExactly(this Stream stream, byte[] buffer, int offset, int count)
parameter | description |
---|---|
stream | The stream to read from. |
buffer | The buffer to read data into. |
offset | The offset within the buffer at which data is first written. |
count | The count of bytes to read. |