public interface BinaryPayloadCodec
Modifier and Type | Method and Description |
---|---|
Payload |
decode(ByteBuffer buffer)
Decode a
Payload structure from the provided BLOB |
ByteBuffer |
encode(Payload payload,
ByteBuffer buffer)
Encode a
Payload structure into a BLOB |
ByteBuffer encode(Payload payload, ByteBuffer buffer) throws Exception
Payload
structure into a BLOB
The payload information gets encoded into a blob and appended at the end of the
provided buffer. If the provided buffer is null
a new buffer will be allocated.
Note: The returning buffer may not be the same as the provided buffer. If the provided buffer has less remaining space than required a new buffer is allocated and returned, which will contain both the existing content as well as the newly appended.
payload
- The payload to encode, must not be null
buffer
- An optional buffer to append the output to, may be null
null
Exception
- if anything goes wrongCopyright © 2017. All rights reserved.