public class CompressionTools extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
compress(byte[] value)
Compresses all bytes in the array, with default BEST_COMPRESSION level
|
static byte[] |
compress(byte[] value,
int offset,
int length)
Compresses the specified byte range, with default BEST_COMPRESSION level
|
static byte[] |
compress(byte[] value,
int offset,
int length,
int compressionLevel)
Compresses the specified byte range using the
specified compressionLevel (constants are defined in
java.util.zip.Deflater).
|
static byte[] |
compressString(String value)
Compresses the String value, with default BEST_COMPRESSION level
|
static byte[] |
compressString(String value,
int compressionLevel)
Compresses the String value using the specified
compressionLevel (constants are defined in
java.util.zip.Deflater).
|
static byte[] |
decompress(byte[] value)
Decompress the byte array previously returned by
compress
|
static byte[] |
decompress(byte[] value,
int offset,
int length)
Decompress the byte array previously returned by
compress
|
static byte[] |
decompress(BytesRef bytes)
Decompress the byte array previously returned by
compress (referenced by the provided BytesRef)
|
static String |
decompressString(byte[] value)
Decompress the byte array previously returned by
compressString back into a String
|
static String |
decompressString(byte[] value,
int offset,
int length)
Decompress the byte array previously returned by
compressString back into a String
|
static String |
decompressString(BytesRef bytes)
Decompress the byte array (referenced by the provided BytesRef)
previously returned by compressString back into a String
|
public static byte[] compress(byte[] value, int offset, int length, int compressionLevel)
public static byte[] compress(byte[] value, int offset, int length)
public static byte[] compress(byte[] value)
public static byte[] compressString(String value)
public static byte[] compressString(String value, int compressionLevel)
public static byte[] decompress(BytesRef bytes) throws DataFormatException
DataFormatException
public static byte[] decompress(byte[] value) throws DataFormatException
DataFormatException
public static byte[] decompress(byte[] value, int offset, int length) throws DataFormatException
DataFormatException
public static String decompressString(byte[] value) throws DataFormatException
DataFormatException
public static String decompressString(byte[] value, int offset, int length) throws DataFormatException
DataFormatException
public static String decompressString(BytesRef bytes) throws DataFormatException
DataFormatException
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.