getBytes
byte[] getBytes(int offset,
int length)
Returns a byte array of length bytes taken from offset bytes
into the payload. If the length given is negative, it is treated
as the length from the end of the payload and the offset is
ignored. If the offset exceeds the size of the payload, getBytes
returns null. If the offset + length exceeds the size of the
payload, the returned byte array is truncated to the size
of the rest of the payload data from the offset.
- Parameters:
offset
- the starting byte offset into the payload.length
- the number of bytes to retrieve.
- Returns:
- the specified section of the payload.