it.geosolutions.imageio.stream.input.compressed
Class GZIPImageInputStream
Object
ImageInputStreamImpl
FilterImageInputStream
InflaterImageInputStream
GZIPImageInputStream
- All Implemented Interfaces:
- DataInput, ImageInputStream
- Direct Known Subclasses:
- GZIPFilterFileImageInputStreamExt
public class GZIPImageInputStream
- extends InflaterImageInputStream
This class implements a stream filter for reading compressed data in the GZIP
format.
- Author:
- Simone Giannecchini, GeoSolutions
Field Summary |
protected CRC32 |
crc
CRC-32 for uncompressed data. |
protected boolean |
eos
Indicates end of input stream. |
static int |
GZIP_MAGIC
GZIP header magic number. |
Method Summary |
void |
close()
Closes this input stream and releases any system resources associated
with the stream. |
int |
read(byte[] buf,
int off,
int len)
Reads uncompressed data into an array of bytes. |
Methods inherited from class ImageInputStreamImpl |
checkClosed, finalize, flush, flushBefore, getBitOffset, getFlushedPosition, getStreamPosition, length, read, readBit, readBits, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF |
Methods inherited from interface ImageInputStream |
flush, flushBefore, getBitOffset, getFlushedPosition, getStreamPosition, length, read, readBit, readBits, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF |
GZIP_MAGIC
public static final int GZIP_MAGIC
- GZIP header magic number.
- See Also:
- Constant Field Values
crc
protected CRC32 crc
- CRC-32 for uncompressed data.
eos
protected boolean eos
- Indicates end of input stream.
GZIPImageInputStream
public GZIPImageInputStream(ImageInputStream iis)
throws IOException
- Creates a new input stream with the specified buffer size.
- Parameters:
in
- the input streamsize
- the input buffer size
- Throws:
IOException
- if an I/O error has occurred
IllegalArgumentException
- if size is <= 0
read
public int read(byte[] buf,
int off,
int len)
throws IOException
- Reads uncompressed data into an array of bytes. Blocks until enough input
is available for decompression.
- Specified by:
read
in interface ImageInputStream
- Overrides:
read
in class InflaterImageInputStream
- Parameters:
buf
- the buffer into which the data is readoff
- the start offset of the datalen
- the maximum number of bytes read
- Returns:
- the actual number of bytes read, or -1 if the end of the
compressed input stream is reached
- Throws:
IOException
- if an I/O error has occurred or the compressed input
data is corrupt
close
public void close()
throws IOException
- Closes this input stream and releases any system resources associated
with the stream.
- Specified by:
close
in interface ImageInputStream
- Overrides:
close
in class InflaterImageInputStream
- Throws:
IOException
- if an I/O error has occurred
Copyright © 2006-2012 GeoSolutions. All Rights Reserved.