net.rim.device.api.compress
Class GZIPOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--net.rim.device.api.compress.GZIPOutputStream

public class GZIPOutputStream
extends OutputStream

Output stream for writing a data stream compressed with the GZIP algorithm (RFC 1952).

Note this class is not fully implemented; no compression is currently performed.


Constructor Summary
GZIPOutputStream(OutputStream outputStream)
          Creates a new GZIPOutputStream instance.
 
Method Summary
 void close()
          Closes this output stream.
 void flush()
          Flushes this stream, writing out any remaining buffered data.
 void write(byte[] data)
          Writes a byte array of data to this stream.
 void write(byte[] data, int dataOffset, int dataLength)
          Writes some bytes from byte array to this stream.
 void write(int data)
          Writes a byte to this stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GZIPOutputStream

public GZIPOutputStream(OutputStream outputStream)
Creates a new GZIPOutputStream instance.

Parameters:
outputStream - Underlying output stream to use.
Method Detail

write

public void write(int data)
           throws IOException
Writes a byte to this stream.

Overrides:
write in class OutputStream
Parameters:
data - the byte to be written

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

write

public void write(byte[] data)
           throws IOException
Writes a byte array of data to this stream.

Invoke this method to compress, and then write, the bytes contained in the input array to this stream.

Overrides:
write in class OutputStream
Parameters:
data - Data to write.
Throws:
IOException - If an I/O error occurs.
Since:
JDE 4.0.2

write

public void write(byte[] data,
                  int dataOffset,
                  int dataLength)
           throws IOException
Writes some bytes from byte array to this stream.

Invoke this method to compress, and then write, some bytes contained in the input array to this stream.

Overrides:
write in class OutputStream
Parameters:
data - Data to write.
dataOffset - First byte from provided array to compress and write.
dataLength - Number of bytes from provided array to compress and write.
Throws:
IOException - If an I/O error occurs.
Since:
JDE 4.0.2

flush

public void flush()
           throws IOException
Flushes this stream, writing out any remaining buffered data.

Overrides:
flush in class OutputStream
Throws:
IOException - If an I/O error occurs.

close

public void close()
           throws IOException
Closes this output stream.

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


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