com.sun.jimi.core.util.lzw
Class BitInput
java.lang.Object
|
+--com.sun.jimi.core.util.lzw.BitInput
- public class BitInput
- extends java.lang.Object
Class to retrieve sets of bits from an input stream.
This class only tested so far with bit sizes varying from 1 to 12
After construction setNumBits
must be caleed before any
call read
.
Constructor Summary |
BitInput(java.io.InputStream in,
boolean blocks)
BitInput consturctor. |
Method Summary |
void |
gifFinishBlocks()
This method allows the LZWDecompressor to skip past the end of
input compressed GIF block data. |
int |
read()
|
void |
setNumBits(int numBits)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
BitInput
public BitInput(java.io.InputStream in,
boolean blocks)
- BitInput consturctor.
setNumBits
must be called before any calls to
read
.
- Parameters:
in
- input source for data to read as bitsblocks
- if true then first byte red is treated
as a byte count of following bytes which are compressed.
setNumBits
public void setNumBits(int numBits)
- Parameters:
setCodeSize
- the number of bits to read to get code
read
public int read()
throws java.io.IOException
- Returns:
- a value of length bits as last set by setCodeSize
- Throws:
- java.io.IOException - thrown if error reading underlying input stream
- java.io.EOFException - thrown if end of file reached.
gifFinishBlocks
public void gifFinishBlocks()
throws java.io.IOException
- This method allows the LZWDecompressor to skip past the end of
input compressed GIF block data.
When called byteCount_ is always non-zero.