org.apache.hadoop.io.compress
Class LzoCodec

java.lang.Object
  extended by org.apache.hadoop.io.compress.LzoCodec
All Implemented Interfaces:
Configurable, CompressionCodec

public class LzoCodec
extends Object
implements Configurable, CompressionCodec

A CompressionCodec for a streaming lzo compression/decompression pair. http://www.oberhumer.com/opensource/lzo/

Author:
Arun C Murthy

Constructor Summary
LzoCodec()
           
 
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.
 Configuration getConf()
          Return the configuration used by this object.
 String getDefaultExtension()
          Get the default filename extension for this kind of compression.
static boolean isNativeLzoLoaded()
          Check if native-lzo library is loaded & initialized.
 void setConf(Configuration conf)
          Set the configuration to be used by this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LzoCodec

public LzoCodec()
Method Detail

setConf

public void setConf(Configuration conf)
Description copied from interface: Configurable
Set the configuration to be used by this object.

Specified by:
setConf in interface Configurable

getConf

public Configuration getConf()
Description copied from interface: Configurable
Return the configuration used by this object.

Specified by:
getConf in interface Configurable

isNativeLzoLoaded

public static boolean isNativeLzoLoaded()
Check if native-lzo library is loaded & initialized.

Returns:
true if native-lzo library is loaded & initialized; else false

createOutputStream

public CompressionOutputStream createOutputStream(OutputStream out)
                                           throws IOException
Description copied from interface: CompressionCodec
Create a stream compressor that will write to the given output stream.

Specified by:
createOutputStream in interface CompressionCodec
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
Description copied from interface: CompressionCodec
Create a stream decompressor that will read from the given input stream.

Specified by:
createInputStream in interface CompressionCodec
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
Returns:
the extension including the '.'


Copyright © 2006 The Apache Software Foundation