Package elki.data

Class 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 to Short.MAX_VALUE dimensions, 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
      BitVector fromByteBuffer​(java.nio.ByteBuffer buffer)
      Deserialize an object from a byte buffer (e.g., disk)
      int getByteSize​(BitVector vec)
      Get the size of the object in bytes.
      void toByteBuffer​(java.nio.ByteBuffer buffer, BitVector vec)
      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

      • ShortSerializer

        public ShortSerializer()
    • Method Detail

      • fromByteBuffer

        public BitVector 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 interface ByteBufferSerializer<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.IOException
        Description copied from interface: ByteBufferSerializer
        Serialize the object to a byte array (e.g., disk)
        Specified by:
        toByteBuffer in interface ByteBufferSerializer<BitVector>
        Parameters:
        buffer - Buffer to serialize to
        vec - Object to serialize
        Throws:
        java.io.IOException - on IO errors