public class ArrayLongCompressed extends Object
Constructor and Description |
---|
ArrayLongCompressed(byte[] bytes)
Create
LongArrayCompressed from bytes formerly got from
toByteArray() . |
ArrayLongCompressed(int size,
int leadingClearBits,
int trailingClearBits)
Create
LongArrayCompressed from number of longs to be
stored, the number of leading and trailing clear bits. |
ArrayLongCompressed(long[] longs)
Create
LongArrayCompressed from longs representing the data
to be stored in compressed form. |
ArrayLongCompressed(long[] longs,
int offset,
int length)
Create
LongArrayCompressed from longs representing the data
to be stored in compressed form (from offset to offset+length). |
Modifier and Type | Method and Description |
---|---|
long |
get(int index)
Get value from the given index.
|
void |
set(int index,
long value)
Set value at the given index.
|
byte[] |
toByteArray()
Get bytes representing the internal data structure with which an
LongArrayCompressed can be reconstructed. |
public ArrayLongCompressed(byte[] bytes)
LongArrayCompressed
from bytes formerly got from
toByteArray()
.bytes
- bytes formerly got from toByteArray()
public ArrayLongCompressed(int size, int leadingClearBits, int trailingClearBits)
LongArrayCompressed
from number of longs to be
stored, the number of leading and trailing clear bits. Everything else is
stored in the internal data structure.size
- number of longs to be storedleadingClearBits
- number of leading clear bitstrailingClearBits
- number of trailing clear bitspublic ArrayLongCompressed(long[] longs)
LongArrayCompressed
from longs representing the data
to be stored in compressed form.longs
- longs representing the data to be stored in compressed formpublic ArrayLongCompressed(long[] longs, int offset, int length)
LongArrayCompressed
from longs representing the data
to be stored in compressed form (from offset to offset+length).longs
- longs representing the data to be stored in compressed formoffset
- offset from which on to compress the longslength
- number of longs to compress from the given arraypublic void set(int index, long value)
index
- index at which the value should be setvalue
- value to be set at the given indexpublic long get(int index)
index
- index at which the value should be setpublic byte[] toByteArray()
LongArrayCompressed
can be reconstructed.LongArrayCompressed
can be reconstructed