de.lmu.ifi.dbs.elki.database.ids.integer
Class IntegerDBID.DynamicSerializer

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.database.ids.integer.IntegerDBID.DynamicSerializer
All Implemented Interfaces:
ByteBufferSerializer<DBID>
Enclosing class:
IntegerDBID

public static class IntegerDBID.DynamicSerializer
extends Object
implements ByteBufferSerializer<DBID>

Dynamic sized serializer, using varint.


Constructor Summary
protected IntegerDBID.DynamicSerializer()
          Constructor.
 
Method Summary
 DBID fromByteBuffer(ByteBuffer buffer)
          Deserialize an object from a byte buffer (e.g. disk)
 int getByteSize(DBID object)
          Get the size of the object in bytes.
 void toByteBuffer(ByteBuffer buffer, DBID object)
          Serialize the object to a byte array (e.g. disk)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerDBID.DynamicSerializer

protected IntegerDBID.DynamicSerializer()
Constructor. Protected: use static instance!

Method Detail

fromByteBuffer

public DBID fromByteBuffer(ByteBuffer buffer)
                    throws UnsupportedOperationException
Description copied from interface: ByteBufferSerializer
Deserialize an object from a byte buffer (e.g. disk)

Specified by:
fromByteBuffer in interface ByteBufferSerializer<DBID>
Parameters:
buffer - Data array to process
Returns:
Deserialized object
Throws:
UnsupportedOperationException

toByteBuffer

public void toByteBuffer(ByteBuffer buffer,
                         DBID object)
                  throws UnsupportedOperationException
Description copied from interface: ByteBufferSerializer
Serialize the object to a byte array (e.g. disk)

Specified by:
toByteBuffer in interface ByteBufferSerializer<DBID>
Parameters:
buffer - Buffer to serialize to
object - Object to serialize
Throws:
UnsupportedOperationException

getByteSize

public int getByteSize(DBID object)
                throws UnsupportedOperationException
Description copied from interface: ByteBufferSerializer
Get the size of the object in bytes.

Specified by:
getByteSize in interface ByteBufferSerializer<DBID>
Parameters:
object - Object to serialize
Returns:
maximum size in serialized form
Throws:
UnsupportedOperationException

Release 0.4.0 (2011-09-20_1324)