Package elki.data
Class BitVector.ShortSerializer
- java.lang.Object
-
- elki.data.BitVector.ShortSerializer
-
- All Implemented Interfaces:
ByteBufferSerializer<BitVector>
- Enclosing class:
- BitVector
public static class BitVector.ShortSerializer extends java.lang.Object implements ByteBufferSerializer<BitVector>
Serialization class for dense integer vectors with up toShort.MAX_VALUEdimensions, by using a short for storing the dimensionality.- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Constructor Description ShortSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BitVectorfromByteBuffer(java.nio.ByteBuffer buffer)Deserialize an object from a byte buffer (e.g., disk)intgetByteSize(BitVector vec)Get the size of the object in bytes.voidtoByteBuffer(java.nio.ByteBuffer buffer, BitVector vec)Serialize the object to a byte array (e.g., disk)
-
-
-
Method Detail
-
fromByteBuffer
public BitVector fromByteBuffer(java.nio.ByteBuffer buffer) throws java.io.IOException
Description copied from interface:ByteBufferSerializerDeserialize an object from a byte buffer (e.g., disk)- Specified by:
fromByteBufferin interfaceByteBufferSerializer<BitVector>- Parameters:
buffer- Data array to process- Returns:
- Deserialized object
- Throws:
java.io.IOException- on IO errors
-
toByteBuffer
public void toByteBuffer(java.nio.ByteBuffer buffer, BitVector vec) throws java.io.IOExceptionDescription copied from interface:ByteBufferSerializerSerialize the object to a byte array (e.g., disk)- Specified by:
toByteBufferin interfaceByteBufferSerializer<BitVector>- Parameters:
buffer- Buffer to serialize tovec- Object to serialize- Throws:
java.io.IOException- on IO errors
-
getByteSize
public int getByteSize(BitVector vec)
Description copied from interface:ByteBufferSerializerGet the size of the object in bytes.- Specified by:
getByteSizein interfaceByteBufferSerializer<BitVector>- Parameters:
vec- Object to serialize- Returns:
- maximum size in serialized form
-
-