org.apache.hadoop.hbase.io.compress
Class Compression

java.lang.Object
  extended by org.apache.hadoop.hbase.io.compress.Compression

@InterfaceAudience.Private
public final class Compression
extends Object

Compression related stuff. Copied from hadoop-3315 tfile.


Nested Class Summary
static class Compression.Algorithm
          Compression algorithms.
 
Method Summary
static void decompress(byte[] dest, int destOffset, InputStream bufferedBoundedStream, int compressedSize, int uncompressedSize, Compression.Algorithm compressAlgo)
          Decompresses data from the given stream using the configured compression algorithm.
static Compression.Algorithm getCompressionAlgorithmByName(String compressName)
           
static String[] getSupportedAlgorithms()
          Get names of supported compression algorithms.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCompressionAlgorithmByName

public static Compression.Algorithm getCompressionAlgorithmByName(String compressName)

getSupportedAlgorithms

public static String[] getSupportedAlgorithms()
Get names of supported compression algorithms.

Returns:
Array of strings, each represents a supported compression algorithm. Currently, the following compression algorithms are supported.

decompress

public static void decompress(byte[] dest,
                              int destOffset,
                              InputStream bufferedBoundedStream,
                              int compressedSize,
                              int uncompressedSize,
                              Compression.Algorithm compressAlgo)
                       throws IOException
Decompresses data from the given stream using the configured compression algorithm. It will throw an exception if the dest buffer does not have enough space to hold the decompressed data.

Parameters:
dest - the output bytes buffer
destOffset - start writing position of the output buffer
bufferedBoundedStream - a stream to read compressed data from, bounded to the exact amount of compressed data
compressedSize - compressed data size, header not included
uncompressedSize - uncompressed data size, header not included
compressAlgo - compression algorithm used
Throws:
IOException


Copyright © 2015 The Apache Software Foundation. All Rights Reserved.