com.amazon.carbonado.raw
Class GzipCompressor

java.lang.Object
  extended by com.amazon.carbonado.raw.GzipCompressor

public class GzipCompressor
extends Object

Raw-level data compression using gzip.

Author:
Olga Kuznetsova, Brian S O'Neill

Constructor Summary
GzipCompressor()
           
 
Method Summary
static byte[] compress(byte[] value, int prefix)
          Encodes into compressed form.
static byte[] decompress(byte[] value, int prefix)
          Decodes from compressed form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GzipCompressor

public GzipCompressor()
Method Detail

compress

public static byte[] compress(byte[] value,
                              int prefix)
                       throws SupportException
Encodes into compressed form.

Parameters:
value - value to compress
prefix - prefix of byte array to preserve
Returns:
compressed value
Throws:
SupportException - thrown if compression failed

decompress

public static byte[] decompress(byte[] value,
                                int prefix)
                         throws CorruptEncodingException
Decodes from compressed form.

Parameters:
value - value to decompress
prefix - prefix of byte array to preserve
Returns:
decompressed value
Throws:
CorruptEncodingException - thrown if value cannot be decompressed


Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.