de.lmu.ifi.dbs.elki.persistent
Class ByteArrayUtil.ByteSerializer

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.persistent.ByteArrayUtil.ByteSerializer
All Implemented Interfaces:
ByteBufferSerializer<Byte>, FixedSizeByteBufferSerializer<Byte>
Enclosing class:
ByteArrayUtil

public static class ByteArrayUtil.ByteSerializer
extends Object
implements FixedSizeByteBufferSerializer<Byte>

Serializer for byte objects


Constructor Summary
protected ByteArrayUtil.ByteSerializer()
          Constructor.
 
Method Summary
 Byte fromByteBuffer(ByteBuffer buffer)
          Deserialize an object from a byte buffer (e.g. disk)
 int getByteSize(Byte object)
          Get the size of the object in bytes.
 int getFixedByteSize()
          Get the fixed size needed by this serializer.
 void toByteBuffer(ByteBuffer buffer, Byte obj)
          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

ByteArrayUtil.ByteSerializer

protected ByteArrayUtil.ByteSerializer()
Constructor. Protected: use static instance!

Method Detail

fromByteBuffer

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

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

toByteBuffer

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

Specified by:
toByteBuffer in interface ByteBufferSerializer<Byte>
Parameters:
buffer - Buffer to serialize to
obj - Object to serialize

getByteSize

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

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

getFixedByteSize

public int getFixedByteSize()
Description copied from interface: FixedSizeByteBufferSerializer
Get the fixed size needed by this serializer.

Specified by:
getFixedByteSize in interface FixedSizeByteBufferSerializer<Byte>
Returns:
Size

Release 0.4.0 (2011-09-20_1324)