net.rim.device.api.compress
Class GZIPInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--net.rim.device.api.compress.GZIPInputStream

public class GZIPInputStream
extends InputStream

Input stream for reading a data stream compressed with the GZIP algorithm (RFC 1952).


Constructor Summary
GZIPInputStream(InputStream inputStream)
          Creates a new GZIPInputStream instance.
GZIPInputStream(InputStream inputStream, int workingBufferSize)
          Creates a new GZIPInputStream 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

GZIPInputStream

public GZIPInputStream(InputStream inputStream)
Creates a new GZIPInputStream instance.

Parameters:
inputStream - Underlying input stream to use.

GZIPInputStream

public GZIPInputStream(InputStream inputStream,
                       int workingBufferSize)
Creates a new GZIPInputStream instance.

Parameters:
inputStream - Underlying input stream to use.
workingBufferSize - The buffer size to use for the read window; cannot be less than 1024.
Since:
JDE 4.1.0
Method Detail

available

public int available()
              throws IOException
Retreives number of bytes which can be read from this stream without blocking.

Overrides:
available in class InputStream
Returns:
Number of bytes availble to be read without blocking.

Throws:
IOException - If an I/O error occurs.

close

public void close()
           throws IOException
Closes this stream.

Overrides:
close in class InputStream
Throws:
IOException - If an I/O error occurs.

read

public int read()
         throws IOException
Retrieves one byte from this input stream.

Overrides:
read in class InputStream
Returns:
Byte of decompressed data, or -1 if no more data in this stream.

Throws:
IOException - If an I/O error occurs.

read

public int read(byte[] buffer,
                int bufferOffset,
                int bufferLength)
         throws IOException
Read specified number of bytes from this stream.

Overrides:
read in class InputStream
Parameters:
buffer - 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.
Returns:
0 if length of output parameter byte array is zero; otherwise, the number of bytes actually read into the buffer. If no more data was available when you invoked this method, it returns -1.
Throws:
IOException - If an I/O error occurs.



Copyright 1999-2008 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.