Encoder.GZIPOutputStreamEx Class Reference

List of all members.

Public Member Functions

 GZIPOutputStreamEx (OutputStream out, int size, int compression) throws IOException
 GZIPOutputStreamEx (OutputStream out, int compression) throws IOException
synchronized void write (byte[] buf, int off, int len) throws IOException
void finish () throws IOException
void close () throws IOException

Protected Attributes

CRC32 crc = new CRC32()

Private Member Functions

void writeHeader () throws IOException
void writeTrailer () throws IOException
void writeInt (int i) throws IOException
void writeShort (int s) throws IOException

Static Private Attributes

static final int GZIP_MAGIC = 0x8b1f


Detailed Description

This class essentially copies sources of original GZIPOutputStream, just adds ability to pass in desired compression level into constructor

Definition at line 10 of file GZIPOutputStreamEx.java.


Constructor & Destructor Documentation

Encoder.GZIPOutputStreamEx.GZIPOutputStreamEx ( OutputStream  out,
int  size,
int  compression 
) throws IOException

Creates a new output stream with the specified buffer size.

Parameters:
out the output stream
size the output buffer size
Exceptions:
IOException If an I/O error has occurred.
IllegalArgumentException if size is <= 0

Definition at line 29 of file GZIPOutputStreamEx.java.

Encoder.GZIPOutputStreamEx.GZIPOutputStreamEx ( OutputStream  out,
int  compression 
) throws IOException

Creates a new output stream with a default buffer size.

Parameters:
out the output stream
Exceptions:
IOException If an I/O error has occurred.

Definition at line 41 of file GZIPOutputStreamEx.java.


Member Function Documentation

synchronized void Encoder.GZIPOutputStreamEx.write ( byte[]  buf,
int  off,
int  len 
) throws IOException

Writes array of bytes to the compressed output stream. This method will block until all the bytes are written.

Parameters:
buf the data to be written
off the start offset of the data
len the length of the data
Exceptions:
IOException If an I/O error has occurred.

Definition at line 54 of file GZIPOutputStreamEx.java.

void Encoder.GZIPOutputStreamEx.finish (  )  throws IOException

Finishes writing compressed data to the output stream without closing the underlying stream. Use this method when applying multiple filters in succession to the same output stream.

Exceptions:
IOException if an I/O error has occurred

Definition at line 67 of file GZIPOutputStreamEx.java.

Referenced by Encoder.GZIPOutputStreamEx.close().

void Encoder.GZIPOutputStreamEx.close (  )  throws IOException

Writes remaining compressed data to the output stream and closes the underlying stream.

Exceptions:
IOException if an I/O error has occurred

Definition at line 85 of file GZIPOutputStreamEx.java.

void Encoder.GZIPOutputStreamEx.writeHeader (  )  throws IOException [private]

void Encoder.GZIPOutputStreamEx.writeTrailer (  )  throws IOException [private]

Definition at line 107 of file GZIPOutputStreamEx.java.

Referenced by Encoder.GZIPOutputStreamEx.finish().

void Encoder.GZIPOutputStreamEx.writeInt ( int  i  )  throws IOException [private]

void Encoder.GZIPOutputStreamEx.writeShort ( int  s  )  throws IOException [private]


Member Data Documentation

CRC32 Encoder.GZIPOutputStreamEx.crc = new CRC32() [protected]

final int Encoder.GZIPOutputStreamEx.GZIP_MAGIC = 0x8b1f [static, private]

Definition at line 20 of file GZIPOutputStreamEx.java.

Referenced by Encoder.GZIPOutputStreamEx.writeHeader().


The documentation for this class was generated from the following file:

Generated on Tue Jul 8 15:05:12 2008 for NODIC by  doxygen 1.5.5