Reads a byte array from the bytes message stream.

If the length of array value is less than the number of bytes remaining to be read from the stream, the array should be filled. A subsequent call reads the next increment, and so on.

If the number of bytes remaining in the stream is less than the length of array value, the bytes should be read into the array. The return value of the total number of bytes read will be less than the length of the array, indicating that there are no more bytes left to be read from the stream. The next read of the stream returns -1.

Namespace:  Kaazing.JMS
Assembly:  Kaazing.JMS (in Kaazing.JMS.dll)

Syntax

Visual Basic
Function ReadBytes ( _
	value As Byte() _
) As Integer
C#
int ReadBytes(
	byte[] value
)
Visual C++
int ReadBytes(
	array<unsigned char>^ value
)

Parameters

value
Type: array<System..::..Byte>[]()[][]
the buffer into which the data is read

Return Value

the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached

Exceptions

ExceptionCondition
Kaazing.JMS..::..JMSExceptionif the JMS provider fails to read the message due to some internal error.
Kaazing.JMS..::..MessageNotReadableExceptionif the message is in write-only mode.

See Also