Package elki.data
Class DoubleVector.SmallSerializer
- java.lang.Object
-
- elki.data.DoubleVector.SmallSerializer
-
- All Implemented Interfaces:
ByteBufferSerializer<DoubleVector>
- Enclosing class:
- DoubleVector
public static class DoubleVector.SmallSerializer extends java.lang.Object implements ByteBufferSerializer<DoubleVector>
Serialization class for dense double vectors with up to 127 dimensions, by using a byte for storing the dimensionality.- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Constructor Description SmallSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DoubleVector
fromByteBuffer(java.nio.ByteBuffer buffer)
Deserialize an object from a byte buffer (e.g., disk)int
getByteSize(DoubleVector vec)
Get the size of the object in bytes.void
toByteBuffer(java.nio.ByteBuffer buffer, DoubleVector vec)
Serialize the object to a byte array (e.g., disk)
-
-
-
Method Detail
-
fromByteBuffer
public DoubleVector 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<DoubleVector>
- Parameters:
buffer
- Data array to process- Returns:
- Deserialized object
- Throws:
java.io.IOException
- on IO errors
-
toByteBuffer
public void toByteBuffer(java.nio.ByteBuffer buffer, DoubleVector vec) throws java.io.IOException
Description copied from interface:ByteBufferSerializer
Serialize the object to a byte array (e.g., disk)- Specified by:
toByteBuffer
in interfaceByteBufferSerializer<DoubleVector>
- Parameters:
buffer
- Buffer to serialize tovec
- Object to serialize- Throws:
java.io.IOException
- on IO errors
-
getByteSize
public int getByteSize(DoubleVector vec)
Description copied from interface:ByteBufferSerializer
Get the size of the object in bytes.- Specified by:
getByteSize
in interfaceByteBufferSerializer<DoubleVector>
- Parameters:
vec
- Object to serialize- Returns:
- maximum size in serialized form
-
-