Package elki.database.ids.integer
Class IntegerDBID.StaticSerializer
- java.lang.Object
-
- elki.database.ids.integer.IntegerDBID.StaticSerializer
-
- All Implemented Interfaces:
ByteBufferSerializer<DBID>
,FixedSizeByteBufferSerializer<DBID>
- Enclosing class:
- IntegerDBID
public static class IntegerDBID.StaticSerializer extends java.lang.Object implements FixedSizeByteBufferSerializer<DBID>
Static sized serializer, using regular integers.- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Constructor Description StaticSerializer()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DBID
fromByteBuffer(java.nio.ByteBuffer buffer)
Deserialize an object from a byte buffer (e.g., disk)int
getByteSize(DBID object)
Get the size of the object in bytes.int
getFixedByteSize()
Get the fixed size needed by this serializer.void
toByteBuffer(java.nio.ByteBuffer buffer, DBID object)
Serialize the object to a byte array (e.g., disk)
-
-
-
Method Detail
-
fromByteBuffer
public DBID fromByteBuffer(java.nio.ByteBuffer buffer) throws java.io.IOException
Description copied from interface:ByteBufferSerializer
Deserialize an object from a byte buffer (e.g., disk)- Specified by:
fromByteBuffer
in interfaceByteBufferSerializer<DBID>
- Parameters:
buffer
- Data array to process- Returns:
- Deserialized object
- Throws:
java.io.IOException
- on IO errors
-
toByteBuffer
public void toByteBuffer(java.nio.ByteBuffer buffer, DBID object) throws java.io.IOException
Description copied from interface:ByteBufferSerializer
Serialize the object to a byte array (e.g., disk)- Specified by:
toByteBuffer
in interfaceByteBufferSerializer<DBID>
- Parameters:
buffer
- Buffer to serialize toobject
- Object to serialize- Throws:
java.io.IOException
- on IO errors
-
getByteSize
public int getByteSize(DBID object) throws java.io.IOException
Description copied from interface:ByteBufferSerializer
Get the size of the object in bytes.- Specified by:
getByteSize
in interfaceByteBufferSerializer<DBID>
- Parameters:
object
- Object to serialize- Returns:
- maximum size in serialized form
- Throws:
java.io.IOException
- on IO errors
-
getFixedByteSize
public int getFixedByteSize()
Description copied from interface:FixedSizeByteBufferSerializer
Get the fixed size needed by this serializer.- Specified by:
getFixedByteSize
in interfaceFixedSizeByteBufferSerializer<DBID>
- Returns:
- Size
-
-