Class LongRleEncoder


  • public class LongRleEncoder
    extends RleEncoder<java.lang.Long>
    Encoder for long value using rle or bit-packing.
    • Constructor Detail

      • LongRleEncoder

        public LongRleEncoder()
        Constructor of LongRleEncoder.
    • Method Detail

      • encode

        public void encode​(long value,
                           java.io.ByteArrayOutputStream out)
        Overrides:
        encode in class RleEncoder<java.lang.Long>
      • flush

        public void flush​(java.io.ByteArrayOutputStream out)
                   throws java.io.IOException
        write all values buffered in cache to OutputStream.
        Overrides:
        flush in class RleEncoder<java.lang.Long>
        Parameters:
        out - - byteArrayOutputStream
        Throws:
        java.io.IOException - cannot flush to OutputStream
      • reset

        protected void reset()
        Overrides:
        reset in class RleEncoder<java.lang.Long>
      • writeRleRun

        protected void writeRleRun()
                            throws java.io.IOException
        write bytes to OutputStream using rle rle format: [header][value].
        Specified by:
        writeRleRun in class RleEncoder<java.lang.Long>
        Throws:
        java.io.IOException - cannot write rle run
      • clearBuffer

        protected void clearBuffer()
        Description copied from class: RleEncoder
        clean all useless value in bufferedValues and set 0.
        Specified by:
        clearBuffer in class RleEncoder<java.lang.Long>
      • 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