Class VorbisBitArray


  • @Deprecated
    public final class VorbisBitArray
    extends Object
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    Wraps a byte array, providing methods that allow it to be read as a Vorbis bitstream.

    See the Vorbis bitpacking specification

    • Constructor Detail

      • VorbisBitArray

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

      • reset

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

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

        public int readBits​(int numBits)
        Deprecated.
        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)
        Deprecated.
        Skips numberOfBits bits.
        Parameters:
        numBits - The number of bits to skip.
      • getPosition

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

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

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