org.egothor.util.io
Class GZipOutputStream

java.lang.Object
  extended by org.egothor.io.DataOutputStream
      extended by org.egothor.util.io.GZipOutputStream
All Implemented Interfaces:
DataOutput

public class GZipOutputStream
extends DataOutputStream

GZipOutputStream.java Created on 6. srpen 2006, 2:41

Author:
galambos

Constructor Summary
GZipOutputStream(DataOutput out)
           
 
Method Summary
 void close()
          Only flushes the stream, but does not close the underlaying stream.
static byte[] compress(byte[] data, int len)
          Reads the data block of the given length and creates a new data block of this format: (len:int)(data:byte[]) where the length of data is the len the original data block is compressed into the new block and its data part
 void finish()
           
 void flush()
           
 void write(byte[] buf, int offset, int len)
          Description of the Method
 void writeByte(int val)
          Description of the Method
 long written()
          Description of the Method
 
Methods inherited from class org.egothor.io.DataOutputStream
copyFrom, copyFrom, printUTFS, writeBoolean, writeFully, writeInt, writeLong, writePack7, writePack7I, writeShort, writeString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GZipOutputStream

public GZipOutputStream(DataOutput out)
                 throws java.io.IOException
Throws:
java.io.IOException
Method Detail

written

public long written()
Description copied from class: DataOutputStream
Description of the Method

Specified by:
written in interface DataOutput
Specified by:
written in class DataOutputStream
Returns:
Description of the Return Value

writeByte

public void writeByte(int val)
               throws java.io.IOException
Description copied from class: DataOutputStream
Description of the Method

Specified by:
writeByte in interface DataOutput
Specified by:
writeByte in class DataOutputStream
Parameters:
val - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

write

public void write(byte[] buf,
                  int offset,
                  int len)
           throws java.io.IOException
Description copied from class: DataOutputStream
Description of the Method

Specified by:
write in interface DataOutput
Specified by:
write in class DataOutputStream
Parameters:
buf - Description of the Parameter
offset - Description of the Parameter
len - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

finish

public void finish()
            throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Only flushes the stream, but does not close the underlaying stream.

Overrides:
close in class DataOutputStream
Throws:
java.io.IOException - Description of the Exception

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in class DataOutputStream
Throws:
java.io.IOException

compress

public static byte[] compress(byte[] data,
                              int len)
Reads the data block of the given length and creates a new data block of this format: (len:int)(data:byte[]) where

Returns:
null is anything is wrong