|
||||||||||
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
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
any cached bits which have been read in from the underlying stream but not yet returned to the user |
protected int |
numCachedBits
the number of valid bits in 'cachedBits'. |
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary | |
BitInputStream(InputStream is)
Create a BitInputStream, assuming that at least 5 bytes are avaliable on the underlying stream. |
Method Summary | |
int |
read()
Read a byte at the current bit boundary. |
int |
readBit()
Read the next bit from the underlying input stream. |
int |
readBits(int numBits)
Read 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)
Method Detail |
public int read() throws IOException
IOException
public int readBits(int numBits) throws IOException
EOFException
- if the given number of bits are not available
before EOF.
IOException
public int readBit() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |