T
- Object type processedpublic interface ByteBufferSerializer<T>
Modifier and Type | Method and Description |
---|---|
T |
fromByteBuffer(ByteBuffer buffer)
Deserialize an object from a byte buffer (e.g. disk)
|
int |
getByteSize(T object)
Get the size of the object in bytes.
|
void |
toByteBuffer(ByteBuffer buffer,
T object)
Serialize the object to a byte array (e.g. disk)
|
T fromByteBuffer(ByteBuffer buffer) throws IOException, UnsupportedOperationException
buffer
- Data array to processIOException
- on IO errorsUnsupportedOperationException
- When functionality not implemented or
availablevoid toByteBuffer(ByteBuffer buffer, T object) throws IOException, UnsupportedOperationException
buffer
- Buffer to serialize toobject
- Object to serializeIOException
- on IO errorsUnsupportedOperationException
- When functionality not implemented or
availableint getByteSize(T object) throws IOException, UnsupportedOperationException
object
- Object to serializeIOException
- on IO errorsUnsupportedOperationException
- When functionality not implemented or
available