C# Class Lucene.Net.Documents.CompressionTools

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, which is the same format previously used by the now deprecated Field.Store.COMPRESS.
Mostra file Open project: paulirwin/lucene.net Class Usage Examples

Public Methods

Method Description
Compress ( byte value ) : byte[]

Compresses all bytes in the array, with default BEST_COMPRESSION level

Compress ( byte value, int offset, int length ) : byte[]

Compresses the specified byte range, with default BEST_COMPRESSION level

Compress ( byte value, int offset, int length, int compressionLevel ) : byte[]

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

CompressString ( string value ) : byte[]

Compresses the String value, with default BEST_COMPRESSION level

CompressString ( string value, int compressionLevel ) : byte[]

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

Decompress ( BytesRef bytes ) : byte[]

Decompress the byte array previously returned by compress (referenced by the provided BytesRef)

Decompress ( byte value ) : byte[]

Decompress the byte array previously returned by compress

Decompress ( byte value, int offset, int length ) : byte[]

Decompress the byte array previously returned by compress

DecompressString ( BytesRef bytes ) : string

Decompress the byte array (referenced by the provided BytesRef) previously returned by compressString back into a String

DecompressString ( byte value ) : string

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

DecompressString ( byte value, int offset, int length ) : string

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

Private Methods

Method Description
CompressionTools ( ) : System

Method Details

Compress() public static method

Compresses all bytes in the array, with default BEST_COMPRESSION level
public static Compress ( byte value ) : byte[]
value byte
return byte[]

Compress() public static method

Compresses the specified byte range, with default BEST_COMPRESSION level
public static Compress ( byte value, int offset, int length ) : byte[]
value byte
offset int
length int
return byte[]

Compress() public static method

Compresses the specified byte range using the specified compressionLevel (constants are defined in java.util.zip.Deflater).
public static Compress ( byte value, int offset, int length, int compressionLevel ) : byte[]
value byte
offset int
length int
compressionLevel int
return byte[]

CompressString() public static method

Compresses the String value, with default BEST_COMPRESSION level
public static CompressString ( string value ) : byte[]
value string
return byte[]

CompressString() public static method

Compresses the String value using the specified compressionLevel (constants are defined in java.util.zip.Deflater).
public static CompressString ( string value, int compressionLevel ) : byte[]
value string
compressionLevel int
return byte[]

Decompress() public static method

Decompress the byte array previously returned by compress (referenced by the provided BytesRef)
public static Decompress ( BytesRef bytes ) : byte[]
bytes BytesRef
return byte[]

Decompress() public static method

Decompress the byte array previously returned by compress
public static Decompress ( byte value ) : byte[]
value byte
return byte[]

Decompress() public static method

Decompress the byte array previously returned by compress
public static Decompress ( byte value, int offset, int length ) : byte[]
value byte
offset int
length int
return byte[]

DecompressString() public static method

Decompress the byte array (referenced by the provided BytesRef) previously returned by compressString back into a String
public static DecompressString ( BytesRef bytes ) : string
bytes BytesRef
return string

DecompressString() public static method

Decompress the byte array previously returned by compressString back into a String
public static DecompressString ( byte value ) : string
value byte
return string

DecompressString() public static method

Decompress the byte array previously returned by compressString back into a String
public static DecompressString ( byte value, int offset, int length ) : string
value byte
offset int
length int
return string