public class BitsReader extends Object
| Constructor and Description |
|---|
BitsReader(InputStream input) |
| Modifier and Type | Method and Description |
|---|---|
int |
bitsToNextOne()
Counts the number of bits until the next one (true)
bit is set
|
int |
bitsToNextZero()
Counts the number of bits until the next zero (false)
bit is set
|
boolean |
isEOF()
Has the End-Of-File / End-of-Stream been hit?
|
int |
read(int numBits) |
int |
readToByteBoundary()
Reads the number to the next byte boundary,
or -1 if already there.
|
public BitsReader(InputStream input)
public int read(int numBits)
throws IOException
IOExceptionpublic int bitsToNextZero()
throws IOException
eg 1110 is 3, 0 is 0, 10 is 1.
IOExceptionpublic int bitsToNextOne()
throws IOException
eg b1 is 0, b001 is 2, b0000001 is 6
IOExceptionpublic int readToByteBoundary()
throws IOException
IOExceptionpublic boolean isEOF()
Copyright © 2021. All rights reserved.