Package org.apache.lucene.util.compress
Class LowercaseAsciiCompression
- java.lang.Object
-
- org.apache.lucene.util.compress.LowercaseAsciiCompression
-
public final class LowercaseAsciiCompression extends java.lang.ObjectUtility class that can efficiently compress arrays that mostly contain characters in the [0x1F,0x3F) or [0x5F,0x7F) ranges, which notably include all digits, lowercase characters, '.', '-' and '_'.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateLowercaseAsciiCompression()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancompress(byte[] in, int len, byte[] tmp, DataOutput out)Compressin[0:len]intoout.static voiddecompress(DataInput in, byte[] out, int len)Decompress data that has been compressed withcompress(byte[], int, byte[], DataOutput).private static booleanisCompressible(int b)
-
-
-
Method Detail
-
isCompressible
private static final boolean isCompressible(int b)
-
compress
public static boolean compress(byte[] in, int len, byte[] tmp, DataOutput out) throws java.io.IOExceptionCompressin[0:len]intoout. This returnsfalseif the content cannot be compressed. The number of bytes written is guaranteed to be less thanlenotherwise.- Throws:
java.io.IOException
-
decompress
public static void decompress(DataInput in, byte[] out, int len) throws java.io.IOException
Decompress data that has been compressed withcompress(byte[], int, byte[], DataOutput).lenmust be the original length, not the compressed length.- Throws:
java.io.IOException
-
-