Package totalcross.json.zip
Interface BitReader
-
- All Known Implementing Classes:
BitInputStream
public interface BitReader
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanbit()Read one bit.longnrBits()Returns the number of bits that have been read from this bitreader.booleanpad(int width)Check that the rest of the block has been padded with zeros.intread(int width)Read some bits.
-
-
-
Method Detail
-
bit
boolean bit() throws IOExceptionRead one bit.- Returns:
- true if it is a 1 bit.
- Throws:
IOException
-
nrBits
long nrBits()
Returns the number of bits that have been read from this bitreader.- Returns:
- The number of bits read so far.
-
pad
boolean pad(int width) throws IOExceptionCheck that the rest of the block has been padded with zeros.- Parameters:
width- The size in bits of the block to pad. This will typically be 8, 16, 32, 64, 128, 256, etc.- Returns:
- true if the block was zero padded, or false if the the padding contained any one bits.
- Throws:
IOException
-
read
int read(int width) throws IOException
Read some bits.- Parameters:
width- The number of bits to read. (0..32)- Returns:
- the bits
- Throws:
IOException
-
-