java.lang.Object
org.codice.alliance.video.stream.mpegts.netty.BitReader

public class BitReader extends Object
The BitReader wraps a ByteBuf and provides bit-level tools for reading bits, skipping bits, and searching for MPEG-2 (h.262) start codes.
  • Constructor Details

    • BitReader

      public BitReader(io.netty.buffer.ByteBuf byteBuf)
      Parameters:
      byteBuf - must be non-null
  • Method Details

    • testBit

      public boolean testBit() throws EOFException
      Get the next bit's value, but do not actually consume the bit.
      Returns:
      true if the next bit is 1, false if the next bit is 0
      Throws:
      EOFException
    • readableBits

      public long readableBits()
      Get the number of bits that can be read.
      Returns:
      number of readable bits
    • skipBits

      public void skipBits(int numberOfBits) throws EOFException
      Throws:
      EOFException
    • readBit

      public byte readBit() throws EOFException
      Throws:
      EOFException
    • readBits

      public long readBits(int numberOfBits) throws EOFException
      Throws:
      EOFException
    • isByteBoundary

      public boolean isByteBoundary()
    • findStart

      public Optional<Long> findStart()