SerialClientRead Method

Reads a number of bytes from the current received data buffer and writes those bytes into a byte array at the specified offset.

Definition

Namespace: Gemstone.Communication
Assembly: Gemstone.Communication (in Gemstone.Communication.dll) Version: 1.0.128 -- Release Build+c4e32e80ee4b39b519c6e4a0a25ff9269b8be666
public override int Read(
	byte[] buffer,
	int startIndex,
	int length
)

Parameters

buffer  Byte
Destination buffer used to hold copied bytes.
startIndex  Int32
0-based starting index into destination buffer to begin writing data.
length  Int32
The number of bytes to read from current received data buffer and write into buffer.

Return Value

Int32
The number of bytes read.

Implements

IClientRead(Byte, Int32, Int32)

Remarks

This function should only be called from within the ReceiveData event handler. Calling this method outside this event will have unexpected results.

Exceptions

InvalidOperationExceptionNo received data buffer has been defined to read.
ArgumentNullExceptionbuffer is null.
ArgumentOutOfRangeExceptionstartIndex or length is less than 0 -or- startIndex and length will exceed buffer length.

See Also