java.lang.Object
org.elasticsearch.index.codec.ForUtil
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddecode(int bitsPerValue, org.apache.lucene.store.DataInput in, long[] longs) Decode an encoded input stream into an array of longs.static voiddecodeTo32(int bitsPerValue, org.apache.lucene.store.DataInput in, long[] longs) Decodes an encoded input stream into an array of longs, such that each long contains two values, each represented with 32 bits.static voidencode(long[] longs, int bitsPerValue, org.apache.lucene.store.DataOutput out) Encode an array of longs intoout.static intnumBytes(int bitsPerValue) Number of bytes required to encode an array ofBLOCK_SIZElongs withbitsPerValuebits per value.
-
Field Details
-
BLOCK_SIZE_SHIFT
public static final int BLOCK_SIZE_SHIFT- See Also:
-
BLOCK_SIZE
public static final int BLOCK_SIZE- See Also:
-
-
Method Details
-
encode
public static void encode(long[] longs, int bitsPerValue, org.apache.lucene.store.DataOutput out) throws IOException Encode an array of longs intoout. The array size is expected to be a multiple ofBLOCK_SIZE.- Throws:
IOException
-
numBytes
public static int numBytes(int bitsPerValue) Number of bytes required to encode an array ofBLOCK_SIZElongs withbitsPerValuebits per value. -
decode
public static void decode(int bitsPerValue, org.apache.lucene.store.DataInput in, long[] longs) throws IOException Decode an encoded input stream into an array of longs. The array size is expected to be a multiple ofBLOCK_SIZE.- Throws:
IOException
-
decodeTo32
public static void decodeTo32(int bitsPerValue, org.apache.lucene.store.DataInput in, long[] longs) throws IOException Decodes an encoded input stream into an array of longs, such that each long contains two values, each represented with 32 bits. Values [0..63] are encoded in the high-order bits oflongs[0..63], and values [64..127] are encoded in the low-order bits oflongs[0..63]. This representation allows subsequent operations to be performed on two values at a time. The size of the output array is expected to be a multiple ofBLOCK_SIZE.- Throws:
IOException
-