- Type Parameters:
T
- Object type processed
public interface ByteBufferSerializer<T>
Class to convert from and to byte arrays (in index structures).
- Author:
- Erich Schubert
-
Method Summary
Modifier and TypeMethodDescriptionfromByteBuffer
(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)
-
Method Details
-
fromByteBuffer
Deserialize an object from a byte buffer (e.g. disk)- Parameters:
buffer
- Data array to process- Returns:
- Deserialized object
- Throws:
IOException
- on IO errorsUnsupportedOperationException
- When functionality not implemented or available
-
toByteBuffer
Serialize the object to a byte array (e.g. disk)- Parameters:
buffer
- Buffer to serialize toobject
- Object to serialize- Throws:
IOException
- on IO errorsUnsupportedOperationException
- When functionality not implemented or available
-
getByteSize
Get the size of the object in bytes.- Parameters:
object
- Object to serialize- Returns:
- maximum size in serialized form
- Throws:
IOException
- on IO errorsUnsupportedOperationException
- When functionality not implemented or available
-