Class GorillaDecoderV1

    • Field Detail

      • flag

        protected boolean flag
      • leadingZeroNum

        protected int leadingZeroNum
      • tailingZeroNum

        protected int tailingZeroNum
      • isEnd

        protected boolean isEnd
      • buffer

        protected int buffer
      • numberLeftInBuffer

        protected int numberLeftInBuffer
      • nextFlag1

        protected boolean nextFlag1
      • nextFlag2

        protected boolean nextFlag2
    • Constructor Detail

      • GorillaDecoderV1

        protected GorillaDecoderV1()
    • Method Detail

      • reset

        public void reset()
        Specified by:
        reset in class Decoder
      • hasNext

        public boolean hasNext​(java.nio.ByteBuffer buffer)
                        throws java.io.IOException
        Specified by:
        hasNext in class Decoder
        Throws:
        java.io.IOException
      • isEmpty

        protected boolean isEmpty()
      • readBit

        protected boolean readBit​(java.nio.ByteBuffer buffer)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • fillBuffer

        protected void fillBuffer​(java.nio.ByteBuffer buffer)
        read one byte and save it in the buffer.
        Parameters:
        buffer - ByteBuffer to read
      • readIntFromStream

        protected int readIntFromStream​(java.nio.ByteBuffer buffer,
                                        int len)
                                 throws java.io.IOException
        read some bits and convert them to an int value.
        Parameters:
        buffer - stream to read
        len - number of bit to read
        Returns:
        converted int value
        Throws:
        java.io.IOException - cannot read from stream
      • readLongFromStream

        protected long readLongFromStream​(java.nio.ByteBuffer buffer,
                                          int len)
                                   throws java.io.IOException
        read some bits and convert them to a long value.
        Parameters:
        buffer - stream to read
        len - number of bit to read
        Returns:
        converted long value
        Throws:
        java.io.IOException - cannot read from stream