Click or drag to resize

BlockAllocatedMemoryStreamRead Method

Reads a block of bytes from the current stream and writes the data to buffer.

Namespace: GSF.IO
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax
public override int Read(
	byte[] buffer,
	int startIndex,
	int length
)
View Source

Parameters

buffer  Byte
When this method returns, contains the specified byte array with the values between startIndex and (startIndex + length - 1) replaced by the characters read from the current stream.
startIndex  Int32
The byte offset in buffer at which to begin reading.
length  Int32
The maximum number of bytes to read.

Return Value

Int32
The total number of bytes written into the buffer. This can be less than the number of bytes requested if that number of bytes are not currently available, or zero if the end of the stream is reached before any bytes are read.
Exceptions
ExceptionCondition
ArgumentNullExceptionbuffer is null.
ArgumentOutOfRangeExceptionstartIndex or length is less than 0 -or- startIndex and length will exceed buffer length.
ObjectDisposedExceptionThe stream is closed.
See Also