Class BitInputAdapter

    • Constructor Detail

      • BitInputAdapter

        public BitInputAdapter​(Supplier<? extends ByteInput> inputSupplier)
        Creates a new instance with specified input supplier.
        Parameters:
        inputSupplier - the input supplier.
    • Method Detail

      • readInt

        public int readInt​(boolean unsigned,
                           int size)
                    throws IOException
        Description copied from interface: BitInput
        Reads an int value of specified number of bits.
        Specified by:
        readInt in interface BitInput
        Parameters:
        unsigned - a flag for indicating unsigned value; true for unsigned, false for signed.
        size - the number of bits to read; between 1 and (32 - ( unsigned ? 1: 0)), both inclusive.
        Returns:
        an int value of specified size.
        Throws:
        IOException - if an I/O error occurs.
      • align

        public long align​(int bytes)
                   throws IOException
        Description copied from interface: BitInput
        Aligns to specified number of bytes by discarding bits.
        Specified by:
        align in interface BitInput
        Parameters:
        bytes - the number of bytes to align; must be positive.
        Returns:
        the number of bits discarded while aligning.
        Throws:
        IOException - if an I/O error occurs.