|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream java.io.FilterInputStream jwo.utils.gifutils.BitInputStream
public class BitInputStream
Allows the reading of 1 to 32 bits at a time, on any bit boundary. Bits are read from bytes, least significant bit first.
Field Summary | |
---|---|
protected long |
cachedBits
Stores any cached bits which have been read in from the underlying stream but not yet returned to the user |
protected int |
numCachedBits
Number of valid bits in 'cachedBits'. |
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
BitInputStream(InputStream is)
Creates a BitInputStream, assuming that at least 5 bytes are available on the underlying stream. |
Method Summary | |
---|---|
int |
read()
Reads a byte at the current bit boundary. |
int |
readBit()
Reads the next bit from the underlying input stream. |
int |
readBits(int numBits)
Reads the given number of bits (1 to 32) from the underlying input stream. |
Methods inherited from class java.io.FilterInputStream |
---|
available, close, mark, markSupported, read, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long cachedBits
protected int numCachedBits
Constructor Detail |
---|
public BitInputStream(InputStream is)
is
- Underlying input stream upon which to base this one.Method Detail |
---|
public int read() throws IOException
read
in class FilterInputStream
IOException
- If problem reading from input stream.public int readBits(int numBits) throws EOFException, IllegalArgumentException, IOException
numBits
- Number of bits to read.
EOFException
- if the given number of bits are not available before EOF.
IllegalArgumentException
- if numBits is not between 1 and 32.
IOException
- if problem reading bits from input stream.public int readBit() throws IOException
IOException
- if problem reading bits from input stream.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |