jinahya / bit-io

A library for reading/writing arbitrary length of bits.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Skip bits

opened this issue · comments

Consider adding a method that skips ahead by n bits, such as:

       final byte[] bytes = { 0b01011001, 0b01100101 };
       final ArrayByteInput byteInput = new ArrayByteInput( bytes );
       final BitInput bitInput = new DefaultBitInput( byteInput );

       bitInput.skip( 5 );

       final int i = bitInput.readInt( true, 6 );
       final boolean bo = bitInput.readBoolean();
       final byte nibble = bitInput.readByte( true, 4 ); // Or bitInput.readNybble();?

Thank you for such a great suggestion. Let me see what I can do.