Class VorbisBitArray

    • Constructor Detail

      • VorbisBitArray

        public VorbisBitArray​(byte[] data)
        Creates a new instance that wraps an existing array.
        Parameters:
        data - the array to wrap.
    • Method Detail

      • reset

        public void reset()
        Resets the reading position to zero.
      • readBit

        public boolean readBit()
        Reads a single bit.
        Returns:
        true if the bit is set, false otherwise.
      • readBits

        public int readBits​(int numBits)
        Reads up to 32 bits.
        Parameters:
        numBits - The number of bits to read.
        Returns:
        An integer whose bottom numBits bits hold the read data.
      • skipBits

        public void skipBits​(int numBits)
        Skips numberOfBits bits.
        Parameters:
        numBits - The number of bits to skip.
      • getPosition

        public int getPosition()
        Returns the reading position in bits.
      • setPosition

        public void setPosition​(int position)
        Sets the reading position in bits.
        Parameters:
        position - The new reading position in bits.
      • bitsLeft

        public int bitsLeft()
        Returns the number of remaining bits.