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
UnsupportedOperationException
void toByteBuffer(ByteBuffer buffer, T object) throws IOException, UnsupportedOperationException
buffer
- Buffer to serialize toobject
- Object to serializeIOException
UnsupportedOperationException
int getByteSize(T object) throws IOException, UnsupportedOperationException
object
- Object to serializeIOException
UnsupportedOperationException