|
||||||||||
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 jwo.utils.gifutils.GIFInputStream
GIFInputStream provides readXXX() methods useful for reading in the contents of a GIF file. Included are methods which handle LZW decompression of the image data.
Field Summary | |
static int |
MAXIMUM_CODE_LENGTH
the maximum code size in bits for GIF LZW decompression |
protected jwo.utils.gifutils.LZWStringTable |
stringTable
the string table for LZW decompression |
Fields inherited from class jwo.utils.gifutils.BitInputStream |
cachedBits, numCachedBits |
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary | |
GIFInputStream(InputStream is)
|
Method Summary | |
byte |
readByte()
Read an 8 bit byte at the current bit boundary. |
protected short |
readCode(BitInputStream bis)
Read a code from the given BitInputStream using the code size from the instance LZW string table. |
Color |
readColor()
Reads 3 bytes and intereprets them as an RRGGBB hex color. |
byte[] |
readDataBlock()
Read data sub-blocks from the underlying input stream until a block terminator (a single zero byte) is encountered. |
byte[] |
readDataSubBlock()
Read a data sub-block from the underlying stream. |
byte[] |
readImageData(int length)
Read the compressed data for a table-based image and return the decompressed raster data. |
int |
readWord()
Reads an unsigned LSB-first 16 byte word from the underlying stream. |
Methods inherited from class jwo.utils.gifutils.BitInputStream |
read, readBit, readBits |
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 |
public static final int MAXIMUM_CODE_LENGTH
protected jwo.utils.gifutils.LZWStringTable stringTable
Constructor Detail |
public GIFInputStream(InputStream is)
Method Detail |
public byte readByte() throws IOException
EOFException
- if 8 bits are not available.
IOException
public int readWord() throws IOException
EOFException
- if EOF is reached before 2 bytes are read
IOException
public Color readColor() throws IOException
EOFException
- if EOF is reached before 3 bytes are read
IOException
public byte[] readDataSubBlock() throws IOException
EOFException
- if a complete block is not read before EOF
IOException
public byte[] readDataBlock() throws IOException
IOException
protected short readCode(BitInputStream bis) throws IOException
IOException
public byte[] readImageData(int length) throws IOException
GIFFormatException
- if EOF is reached prematurely
or the LZW decoding fails
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |