Class DoubleRLBE


  • public class DoubleRLBE
    extends RLBE
    • Constructor Summary

      Constructors 
      Constructor Description
      DoubleRLBE()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected long calcFibonacci​(long val)
      calculate fibonacci code of input long integer.
      protected void clearBuffer​(java.io.ByteArrayOutputStream out)
      flush bits left in byteBuffer to output stream.
      void encode​(double value, java.io.ByteArrayOutputStream out)  
      void encodeValue​(double value, java.io.ByteArrayOutputStream out)
      encode one input integer value.
      void flush​(java.io.ByteArrayOutputStream out)
      Write all values buffered in memory cache to OutputStream.
      protected void flushBlock​(java.io.ByteArrayOutputStream out)
      flush all encoded values in a block to output stream.
      long getMaxByteSize()
      The maximal possible memory size occupied by current Encoder.
      int getOneItemMaxSize()
      When encoder accepts a new incoming data point, the maximal possible size in byte it takes to store in memory.
      protected void reset()  
      protected void writeBit​(boolean b, java.io.ByteArrayOutputStream out)
      write one bit to byteBuffer, when byteBuffer is full, flush byteBuffer to output stream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DoubleRLBE

        public DoubleRLBE()
    • Method Detail

      • reset

        protected void reset()
      • encodeValue

        public void encodeValue​(double value,
                                java.io.ByteArrayOutputStream out)
        encode one input integer value.
        Parameters:
        value - the integer to be encoded
        out - the output stream to flush in when buffer is full
      • encode

        public void encode​(double value,
                           java.io.ByteArrayOutputStream out)
        Overrides:
        encode in class Encoder
      • flush

        public void flush​(java.io.ByteArrayOutputStream out)
        Description copied from class: Encoder
        Write all values buffered in memory cache to OutputStream.
        Overrides:
        flush in class RLBE
        Parameters:
        out - - ByteArrayOutputStream
      • calcFibonacci

        protected long calcFibonacci​(long val)
        calculate fibonacci code of input long integer.
        Parameters:
        val - the long integer to be fibonacci-encoded
        Returns:
        the reverse fibonacci code of val in binary code
      • flushBlock

        protected void flushBlock​(java.io.ByteArrayOutputStream out)
        flush all encoded values in a block to output stream.
        Parameters:
        out - the output stream to be flushed to
      • getOneItemMaxSize

        public int getOneItemMaxSize()
        Description copied from class: Encoder
        When encoder accepts a new incoming data point, the maximal possible size in byte it takes to store in memory.
        Overrides:
        getOneItemMaxSize in class Encoder
        Returns:
        the maximal possible size of one data item encoded by this encoder
      • getMaxByteSize

        public long getMaxByteSize()
        Description copied from class: Encoder
        The maximal possible memory size occupied by current Encoder. This statistic value doesn't involve OutputStream.
        Overrides:
        getMaxByteSize in class Encoder
        Returns:
        the maximal size of possible memory occupied by current encoder
      • writeBit

        protected void writeBit​(boolean b,
                                java.io.ByteArrayOutputStream out)
        write one bit to byteBuffer, when byteBuffer is full, flush byteBuffer to output stream
        Parameters:
        b - the bit to be written
        out - output stream
      • clearBuffer

        protected void clearBuffer​(java.io.ByteArrayOutputStream out)
        flush bits left in byteBuffer to output stream.
        Parameters:
        out - output stream