Class CompressionTools
Simple utility class providing static methods to
compress and decompress binary data for stored fields.
this class uses the System.IO.Compression.DeflateStream
class to compress and decompress.
Inheritance
System.Object
CompressionTools
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Lucene.Net.dll
public static class CompressionTools
Methods
|
Improve this Doc
View Source
Compresses all System.Bytes in the array, with default System.IO.Compression.CompressionLevel.Optimal level
Declaration
public static byte[] Compress(byte[] value)
Parameters
Type |
Name |
Description |
System.Byte[] |
value |
|
Returns
Type |
Description |
System.Byte[] |
|
|
Improve this Doc
View Source
Compresses the specified System.Byte range, with default System.IO.Compression.CompressionLevel.Optimal level
Declaration
public static byte[] Compress(byte[] value, int offset, int length)
Parameters
Type |
Name |
Description |
System.Byte[] |
value |
|
System.Int32 |
offset |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.Byte[] |
|
|
Improve this Doc
View Source
Compresses the specified System.Byte range using the
specified compressionLevel
.
Declaration
public static byte[] Compress(byte[] value, int offset, int length, CompressionLevel compressionLevel)
Parameters
Type |
Name |
Description |
System.Byte[] |
value |
|
System.Int32 |
offset |
|
System.Int32 |
length |
|
System.IO.Compression.CompressionLevel |
compressionLevel |
|
Returns
Type |
Description |
System.Byte[] |
|
|
Improve this Doc
View Source
Compresses the System.String value, with default System.IO.Compression.CompressionLevel.Optimal level
Declaration
public static byte[] CompressString(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
|
Returns
Type |
Description |
System.Byte[] |
|
|
Improve this Doc
View Source
Compresses the System.String value using the specified
compressionLevel
.
Declaration
public static byte[] CompressString(string value, CompressionLevel compressionLevel)
Parameters
Type |
Name |
Description |
System.String |
value |
|
System.IO.Compression.CompressionLevel |
compressionLevel |
|
Returns
Type |
Description |
System.Byte[] |
|
|
Improve this Doc
View Source
Decompress the System.Byte array previously returned by
compress (referenced by the provided BytesRef)
Declaration
public static byte[] Decompress(BytesRef bytes)
Parameters
Returns
Type |
Description |
System.Byte[] |
|
|
Improve this Doc
View Source
Decompress the System.Byte array previously returned by
compress
Declaration
public static byte[] Decompress(byte[] value)
Parameters
Type |
Name |
Description |
System.Byte[] |
value |
|
Returns
Type |
Description |
System.Byte[] |
|
|
Improve this Doc
View Source
Decompress the System.Byte array previously returned by
compress
Declaration
public static byte[] Decompress(byte[] value, int offset, int length)
Parameters
Type |
Name |
Description |
System.Byte[] |
value |
|
System.Int32 |
offset |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.Byte[] |
|
|
Improve this Doc
View Source
Declaration
public static string DecompressString(BytesRef bytes)
Parameters
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Declaration
public static string DecompressString(byte[] value)
Parameters
Type |
Name |
Description |
System.Byte[] |
value |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Declaration
public static string DecompressString(byte[] value, int offset, int length)
Parameters
Type |
Name |
Description |
System.Byte[] |
value |
|
System.Int32 |
offset |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.String |
|