Method ReadBytesSafe
ReadBytesSafe(byte*, int, int)
Read multiple bytes to the stream
"Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.
Declaration
public void ReadBytesSafe(byte* value, int size, int offset = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| byte* | value | Pointer to the destination buffer |
| int | size | Number of bytes to read - MUST BE <= BUFFER SIZE |
| int | offset | Offset of the byte buffer to store into |
ReadBytesSafe(ref byte[], int, int)
Read multiple bytes from the stream
"Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.
Declaration
public void ReadBytesSafe(ref byte[] value, int size, int offset = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | value | Pointer to the destination buffer |
| int | size | Number of bytes to read - MUST BE <= BUFFER SIZE |
| int | offset | Offset of the byte buffer to store into |