org.apache.hadoop.io.compress
Class DefaultCodec.DefaultCompressionOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.apache.hadoop.io.compress.CompressionOutputStream
          extended by org.apache.hadoop.io.compress.DefaultCodec.DefaultCompressionOutputStream
All Implemented Interfaces:
Closeable, Flushable
Direct Known Subclasses:
GzipCodec.GzipOutputStream
Enclosing class:
DefaultCodec

protected static class DefaultCodec.DefaultCompressionOutputStream
extends CompressionOutputStream

A bridge that wraps around a DeflaterOutputStream to make it a CompressionOutputStream.

Author:
Owen O'Malley

Field Summary
 
Fields inherited from class org.apache.hadoop.io.compress.CompressionOutputStream
out
 
Constructor Summary
protected DefaultCodec.DefaultCompressionOutputStream(DeflaterOutputStream out)
          Allow children types to put a different type in here (namely gzip).
  DefaultCodec.DefaultCompressionOutputStream(OutputStream out)
           
 
Method Summary
 void close()
           
 void finish()
          Finishes writing compressed data to the output stream without closing the underlying stream.
 void flush()
           
 void resetState()
          Reset the compression to the initial state.
 void write(byte[] data, int offset, int length)
          Write compressed bytes to the stream.
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCodec.DefaultCompressionOutputStream

public DefaultCodec.DefaultCompressionOutputStream(OutputStream out)

DefaultCodec.DefaultCompressionOutputStream

protected DefaultCodec.DefaultCompressionOutputStream(DeflaterOutputStream out)
Allow children types to put a different type in here (namely gzip).

Parameters:
out - the Deflater stream to use
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class CompressionOutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class CompressionOutputStream
Throws:
IOException

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] data,
                  int offset,
                  int length)
           throws IOException
Description copied from class: CompressionOutputStream
Write compressed bytes to the stream. Made abstract to prevent leakage to underlying stream.

Specified by:
write in class CompressionOutputStream
Throws:
IOException

finish

public void finish()
            throws IOException
Description copied from class: CompressionOutputStream
Finishes writing compressed data to the output stream without closing the underlying stream.

Specified by:
finish in class CompressionOutputStream
Throws:
IOException

resetState

public void resetState()
                throws IOException
Description copied from class: CompressionOutputStream
Reset the compression to the initial state. Does not reset the underlying stream.

Specified by:
resetState in class CompressionOutputStream
Throws:
IOException


Copyright © 2006 The Apache Software Foundation