org.apache.hadoop.io.compress
Interface CompressionCodec

All Known Implementing Classes:
DefaultCodec, GzipCodec, LzoCodec

public interface CompressionCodec

This class encapsulates a streaming compression/decompression pair.

Author:
Owen O'Malley

Method Summary
 CompressionInputStream createInputStream(InputStream in)
          Create a stream decompressor that will read from the given input stream.
 CompressionOutputStream createOutputStream(OutputStream out)
          Create a stream compressor that will write to the given output stream.
 String getDefaultExtension()
          Get the default filename extension for this kind of compression.
 

Method Detail

createOutputStream

CompressionOutputStream createOutputStream(OutputStream out)
                                           throws IOException
Create a stream compressor that will write to the given output stream.

Parameters:
out - the location for the final output stream
Returns:
a stream the user can write uncompressed data to
Throws:
IOException

createInputStream

CompressionInputStream createInputStream(InputStream in)
                                         throws IOException
Create a stream decompressor that will read from the given input stream.

Parameters:
in - the stream to read compressed bytes from
Returns:
a stream to read uncompressed bytes from
Throws:
IOException

getDefaultExtension

String getDefaultExtension()
Get the default filename extension for this kind of compression.

Returns:
the extension including the '.'


Copyright © 2006 The Apache Software Foundation