|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.io.InputStream
|
+--net.rim.device.api.compress.ZLibInputStream
Input stream for reading a data stream compressed with the ZLib algorithm (RFC 1950, RFC 1951).
Sample code
try
{
InputStream inputStream = new
ByteArrayInputStream(compressedData);
ZLibInputStream zlibInputStream = new
ZLibInputStream(inputStream, true);
byte[] data = new byte[uncompressedSize];
zlibInputStream.read(data);
}
catch(IOException ioe)
{
}
| Constructor Summary | ||
ZLibInputStream(InputStream inputStream)
Creates a new ZLibInputStream instance (which requires the ZLib header and trailer wrapping to be present - see other constructor). |
||
ZLibInputStream(InputStream inputStream,
boolean noWrap)
Creates a new ZLibInputStream instance. |
||
ZLibInputStream(InputStream inputStream,
boolean noWrap,
int workingBufferSize)
Creates a new ZLibInputStream instance. |
||
| Method Summary | ||
int |
available()
Retreives number of bytes which can be read from this stream without blocking. |
|
void |
close()
Closes this stream. |
|
int |
read()
Retrieves one byte from this input stream. |
|
int |
read(byte[] buffer,
int bufferOffset,
int bufferLength)
Read specified number of bytes from this stream. |
|
| Methods inherited from class java.io.InputStream |
mark, markSupported, read, reset, skip |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ZLibInputStream(InputStream inputStream)
inputStream - Underlying input stream to use.public ZLibInputStream(InputStream inputStream, boolean noWrap)
If noWrap is true, the decompressor will assume that the
ZLib 16 bit header and the 32 bit trailer checksum are not included in the
underlying input stream. This mode is necessary for PKZip/Info-ZIP and GZIP
compatibility.
inputStream - Underlying input stream to use.noWrap - If true, the header and trailer are not present in the underlying input stream.public ZLibInputStream(InputStream inputStream, boolean noWrap, int workingBufferSize)
If noWrap is true, the decompressor will assume that the
ZLib 16 bit header and the 32 bit trailer checksum are not included in the
underlying input stream. This mode is necessary for PKZip/Info-ZIP and GZIP
compatibility.
inputStream - Underlying input stream to use.noWrap - If true, the header and trailer are not present in the underlying input stream.workingBufferSize - The buffer size to use for the read window; cannot be less than 1024.| Method Detail |
public int available()
throws IOException
available in class InputStreamIOException - If an I/O error occurs.
public void close()
throws IOException
close in class InputStreamIOException - If an I/O error occurs.
public int read()
throws IOException
read in class InputStreamIOException - If an I/O error occurs.
public int read(byte[] buffer,
int bufferOffset,
int bufferLength)
throws IOException
read in class InputStreambuffer - Buffer to contain data; must be large enough to contain
desired number of bytes.bufferOffset - First element in output parameter buffer at which to
begin writing decoded data; if not 0, then output parameter buffer must
be at least bufferOffset + bufferLength elements long.bufferLength - Number of bytes to read from this stream.IOException - If an I/O error occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.