Method RetrievePayloadBuffer
RetrievePayloadBuffer(PayloadHandle, out NativeArray<byte>)
Retrieves a NativeArray to safely access Payload memory.
Declaration
public bool RetrievePayloadBuffer(PayloadHandle handle, out NativeArray<byte> payloadBuffer)
Parameters
Type | Name | Description |
---|---|---|
PayloadHandle | handle | A valid PayloadHandle value for the Payload buffer to access. |
NativeArray<byte> | payloadBuffer | NativeArray that allows safe access to the allocated Payload buffer. |
Returns
Type | Description |
---|---|
bool | True if successfully accessed Payload buffer. |
Remarks
RetrievePayloadBuffer(PayloadHandle, bool, out NativeArray<byte>)
Retrieves a NativeArray to safely access Payload memory.
Declaration
public bool RetrievePayloadBuffer(PayloadHandle handle, bool readWriteAccess, out NativeArray<byte> payloadBuffer)
Parameters
Type | Name | Description |
---|---|---|
PayloadHandle | handle | A valid PayloadHandle value for the Payload buffer to access. |
bool | readWriteAccess | True to allow write-access to the returned NativeArray, otherwise it's read-only |
NativeArray<byte> | payloadBuffer | NativeArray that allows safe access to the allocated Payload buffer. |
Returns
Type | Description |
---|---|
bool | True if successfully accessed Payload buffer. |
Remarks
Listeners must call this to read the log message data when processing a LogMessage. The passed out NativeArray is only intended for immediate reading/writing into the buffer; the variable must not be saved.
By default the return NativeArray is read-only, since typically Listeners only need to de-serialize the buffer contents and don't need to write into the buffer.