org.apache.hadoop.io.compress
Class GzipCodec
java.lang.Object
org.apache.hadoop.io.compress.DefaultCodec
org.apache.hadoop.io.compress.GzipCodec
- All Implemented Interfaces:
- Configurable, CompressionCodec
public class GzipCodec
- extends DefaultCodec
This class creates gzip compressors/decompressors.
- Author:
- Owen O'Malley
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GzipCodec
public GzipCodec()
createOutputStream
public CompressionOutputStream createOutputStream(OutputStream out)
throws IOException
- Create a stream compressor that will write to the given output stream.
- Specified by:
createOutputStream
in interface CompressionCodec
- Overrides:
createOutputStream
in class DefaultCodec
- Parameters:
out
- the location for the final output stream
- Returns:
- a stream the user can write uncompressed data to
- Throws:
IOException
createInputStream
public CompressionInputStream createInputStream(InputStream in)
throws IOException
- Create a stream decompressor that will read from the given input stream.
- Specified by:
createInputStream
in interface CompressionCodec
- Overrides:
createInputStream
in class DefaultCodec
- Parameters:
in
- the stream to read compressed bytes from
- Returns:
- a stream to read uncompressed bytes from
- Throws:
IOException
getDefaultExtension
public String getDefaultExtension()
- Get the default filename extension for this kind of compression.
- Specified by:
getDefaultExtension
in interface CompressionCodec
- Overrides:
getDefaultExtension
in class DefaultCodec
- Returns:
- the extension including the '.'
Copyright © 2006 The Apache Software Foundation