de.lmu.ifi.dbs.elki.persistent
Interface ByteBufferSerializer<T>

Type Parameters:
T - Object type processed
All Known Subinterfaces:
FixedSizeByteBufferSerializer<T>
All Known Implementing Classes:
BitVector, ByteArrayUtil.ByteSerializer, ByteArrayUtil.DoubleSerializer, ByteArrayUtil.FloatSerializer, ByteArrayUtil.IntegerSerializer, ByteArrayUtil.LongSerializer, ByteArrayUtil.ShortSerializer, ByteArrayUtil.StringSerializer, ByteArrayUtil.VarintSerializer, DoubleVector, FloatVector, IntegerDBID.DynamicSerializer, IntegerDBID.StaticSerializer, IntegerVector, ParameterizationFunction

public interface ByteBufferSerializer<T>

Class to convert from and to byte arrays (in index structures)


Method Summary
 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)
 

Method Detail

fromByteBuffer

T fromByteBuffer(ByteBuffer buffer)
                 throws IOException,
                        UnsupportedOperationException
Deserialize an object from a byte buffer (e.g. disk)

Parameters:
buffer - Data array to process
Returns:
Deserialized object
Throws:
IOException
UnsupportedOperationException

toByteBuffer

void toByteBuffer(ByteBuffer buffer,
                  T object)
                  throws IOException,
                         UnsupportedOperationException
Serialize the object to a byte array (e.g. disk)

Parameters:
buffer - Buffer to serialize to
object - Object to serialize
Throws:
IOException
UnsupportedOperationException

getByteSize

int getByteSize(T object)
                throws IOException,
                       UnsupportedOperationException
Get the size of the object in bytes.

Parameters:
object - Object to serialize
Returns:
maximum size in serialized form
Throws:
IOException
UnsupportedOperationException

Release 0.4.0 (2011-09-20_1324)