org.apache.hadoop.io.compress
Class DefaultCodec
java.lang.Object
   org.apache.hadoop.io.compress.DefaultCodec
org.apache.hadoop.io.compress.DefaultCodec
- All Implemented Interfaces: 
- Configurable, CompressionCodec, DirectDecompressionCodec
- Direct Known Subclasses: 
- GzipCodec
- @InterfaceAudience.Public
@InterfaceStability.Evolving
public class DefaultCodec 
- extends Object- implements Configurable, CompressionCodec, DirectDecompressionCodec
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
DefaultCodec
public DefaultCodec()
setConf
public void setConf(Configuration conf)
- Description copied from interface: Configurable
- Set the configuration to be used by this object.
 
- 
- Specified by:
- setConfin interface- Configurable
 
- 
 
getConf
public Configuration getConf()
- Description copied from interface: Configurable
- Return the configuration used by this object.
 
- 
- Specified by:
- getConfin interface- Configurable
 
- 
 
createOutputStream
public CompressionOutputStream createOutputStream(OutputStream out)
                                           throws IOException
- Description copied from interface: CompressionCodec
- Create a CompressionOutputStreamthat will write to the givenOutputStream.
 
- 
- Specified by:
- createOutputStreamin interface- CompressionCodec
 
- 
- Parameters:
- out- the location for the final output stream
- Returns:
- a stream the user can write uncompressed data to have it compressed
- Throws:
- IOException
 
createOutputStream
public CompressionOutputStream createOutputStream(OutputStream out,
                                                  Compressor compressor)
                                           throws IOException
- Description copied from interface: CompressionCodec
- Create a CompressionOutputStreamthat will write to the givenOutputStreamwith the givenCompressor.
 
- 
- Specified by:
- createOutputStreamin interface- CompressionCodec
 
- 
- Parameters:
- out- the location for the final output stream
- compressor- compressor to use
- Returns:
- a stream the user can write uncompressed data to have it compressed
- Throws:
- IOException
 
getCompressorType
public Class<? extends Compressor> getCompressorType()
- Description copied from interface: CompressionCodec
- Get the type of Compressorneeded by thisCompressionCodec.
 
- 
- Specified by:
- getCompressorTypein interface- CompressionCodec
 
- 
- Returns:
- the type of compressor needed by this codec.
 
createCompressor
public Compressor createCompressor()
- Description copied from interface: CompressionCodec
- Create a new Compressorfor use by thisCompressionCodec.
 
- 
- Specified by:
- createCompressorin interface- CompressionCodec
 
- 
- Returns:
- a new compressor for use by this codec
 
createInputStream
public CompressionInputStream createInputStream(InputStream in)
                                         throws IOException
- Description copied from interface: CompressionCodec
- Create a CompressionInputStreamthat will read from the given
 input stream.
 
- 
- Specified by:
- createInputStreamin interface- CompressionCodec
 
- 
- Parameters:
- in- the stream to read compressed bytes from
- Returns:
- a stream to read uncompressed bytes from
- Throws:
- IOException
 
createInputStream
public CompressionInputStream createInputStream(InputStream in,
                                                Decompressor decompressor)
                                         throws IOException
- Description copied from interface: CompressionCodec
- Create a CompressionInputStreamthat will read from the givenInputStreamwith the givenDecompressor.
 
- 
- Specified by:
- createInputStreamin interface- CompressionCodec
 
- 
- Parameters:
- in- the stream to read compressed bytes from
- decompressor- decompressor to use
- Returns:
- a stream to read uncompressed bytes from
- Throws:
- IOException
 
getDecompressorType
public Class<? extends Decompressor> getDecompressorType()
- Description copied from interface: CompressionCodec
- Get the type of Decompressorneeded by thisCompressionCodec.
 
- 
- Specified by:
- getDecompressorTypein interface- CompressionCodec
 
- 
- Returns:
- the type of decompressor needed by this codec.
 
createDecompressor
public Decompressor createDecompressor()
- Description copied from interface: CompressionCodec
- Create a new Decompressorfor use by thisCompressionCodec.
 
- 
- Specified by:
- createDecompressorin interface- CompressionCodec
 
- 
- Returns:
- a new decompressor for use by this codec
 
createDirectDecompressor
public DirectDecompressor createDirectDecompressor()
- Create a new DirectDecompressorfor use by thisDirectDecompressionCodec.
 
- 
- Specified by:
- createDirectDecompressorin interface- DirectDecompressionCodec
 
- 
- Returns:
- a new direct decompressor for use by this codec
 
getDefaultExtension
public String getDefaultExtension()
- Description copied from interface: CompressionCodec
- Get the default filename extension for this kind of compression.
 
- 
- Specified by:
- getDefaultExtensionin interface- CompressionCodec
 
- 
- Returns:
- the extension including the '.'
 
Copyright © 2014 Apache Software Foundation. All Rights Reserved.