java.lang.Object
org.elasticsearch.index.codec.ForUtil

public final class ForUtil extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    decode(int bitsPerValue, org.apache.lucene.store.DataInput in, long[] longs)
    Decode an encoded input stream into an array of longs.
    static void
    decodeTo32(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 void
    encode(long[] longs, int bitsPerValue, org.apache.lucene.store.DataOutput out)
    Encode an array of longs into out.
    static int
    numBytes(int bitsPerValue)
    Number of bytes required to encode an array of BLOCK_SIZE longs with bitsPerValue bits per value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • encode

      public static void encode(long[] longs, int bitsPerValue, org.apache.lucene.store.DataOutput out) throws IOException
      Encode an array of longs into out. The array size is expected to be a multiple of BLOCK_SIZE.
      Throws:
      IOException
    • numBytes

      public static int numBytes(int bitsPerValue)
      Number of bytes required to encode an array of BLOCK_SIZE longs with bitsPerValue bits 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 of BLOCK_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 of longs [0..63], and values [64..127] are encoded in the low-order bits of longs [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 of BLOCK_SIZE.
      Throws:
      IOException