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
      • isEmpty

        protected boolean isEmpty()
      • fillBuffer

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

        protected int readIntFromStream​(ByteBuffer buffer,
                                        int len)
                                 throws 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:
        IOException - cannot read from stream
      • readLongFromStream

        protected long readLongFromStream​(ByteBuffer buffer,
                                          int len)
                                   throws 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:
        IOException - cannot read from stream