public class

CompressionTools

extends Object
java.lang.Object
   ↳ org.apache.lucene.document.CompressionTools

Class Overview

Simple utility class providing static methods to compress and decompress binary data for stored fields. This class uses java.util.zip.Deflater and Inflater classes to compress and decompress.

Summary

Public Methods
static byte[] compress(byte[] value, int offset, int length)
Compresses the specified byte range, with default BEST_COMPRESSION level
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, int compressionLevel)
Compresses the specified byte range using the specified compressionLevel (constants are defined in java.util.zip.Deflater).
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[] compressString(String value)
Compresses the String value, with default BEST_COMPRESSION level
static byte[] decompress(byte[] value)
Decompress the byte array previously returned by compress
static String decompressString(byte[] value)
Decompress the byte array previously returned by compressString back into a String
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static byte[] compress (byte[] value, int offset, int length)

Compresses the specified byte range, with default BEST_COMPRESSION level

public static byte[] compress (byte[] value)

Compresses all bytes in the array, with default BEST_COMPRESSION level

public 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).

public static byte[] compressString (String value, int compressionLevel)

Compresses the String value using the specified compressionLevel (constants are defined in java.util.zip.Deflater).

public static byte[] compressString (String value)

Compresses the String value, with default BEST_COMPRESSION level

public static byte[] decompress (byte[] value)

Decompress the byte array previously returned by compress

public static String decompressString (byte[] value)

Decompress the byte array previously returned by compressString back into a String