Class GorillaEncoderV2

  • Direct Known Subclasses:
    IntChimpEncoder, IntGorillaEncoder, LongChimpEncoder, LongGorillaEncoder

    public abstract class GorillaEncoderV2
    extends Encoder
    This class includes code modified from Michael Burman's gorilla-tsc project.

    Copyright: 2016-2018 Michael Burman and/or other contributors

    Project page: https://github.com/burmanm/gorilla-tsc

    License: http://www.apache.org/licenses/LICENSE-2.0

    • Field Detail

      • firstValueWasWritten

        protected boolean firstValueWasWritten
      • storedLeadingZeros

        protected int storedLeadingZeros
      • storedTrailingZeros

        protected int storedTrailingZeros
      • bitsLeft

        protected int bitsLeft
    • Constructor Detail

      • GorillaEncoderV2

        protected GorillaEncoderV2()
    • Method Detail

      • getMaxByteSize

        public final 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
      • reset

        protected void reset()
      • skipBit

        protected void skipBit​(java.io.ByteArrayOutputStream out)
        Stores a 0 and increases the count of bits by 1.
      • writeBit

        protected void writeBit​(java.io.ByteArrayOutputStream out)
        Stores a 1 and increases the count of bits by 1.
      • writeBits

        protected void writeBits​(long value,
                                 int bits,
                                 java.io.ByteArrayOutputStream out)
        Writes the given long value using the defined amount of least significant bits.
        Parameters:
        value - The long value to be written
        bits - How many bits are stored to the stream
      • flipByte

        protected void flipByte​(java.io.ByteArrayOutputStream out)