public class LongPacker extends Object
e.g., if bit-width is 31, then Long '2147483648'(2^31) is not allowed but '2147483647'(2^31-1) is allowed.
| Constructor and Description |
|---|
LongPacker(int width) |
| Modifier and Type | Method and Description |
|---|---|
void |
pack8Values(long[] values,
int offset,
byte[] buf)
Encode 8 (
NUM_OF_LONGS) Longs from the array 'values' with specified
bit-width to bytes. |
void |
setWidth(int width) |
void |
unpack8Values(byte[] buf,
int offset,
long[] values)
decode values from byte array.
|
void |
unpackAllValues(byte[] buf,
int length,
long[] values)
decode all values from 'buf' with specified offset and length decoded result will be saved in
array named 'values'.
|
public void pack8Values(long[] values,
int offset,
byte[] buf)
NUM_OF_LONGS) Longs from the array 'values' with specified
bit-width to bytes.values - - array where '8 Longs' are inoffset - - the offset of first Long to be encodedbuf - - encoded bytes, buf size must be equal to (NUM_OF_LONGS} *
IntPacker.width / 8)public void unpack8Values(byte[] buf,
int offset,
long[] values)
buf - - array where bytes are in.offset - - offset of first byte to be decoded in bufvalues - - decoded result , the size of values should be 8public void unpackAllValues(byte[] buf,
int length,
long[] values)
buf - array where all bytes are in.length - length of bytes to be decoded in buf.values - decoded resultpublic void setWidth(int width)
Copyright © 2022 The Apache Software Foundation. All rights reserved.