public final class S16 extends Object
Adapted by D. Lemire from the Apache Lucene project.
| Constructor and Description |
|---|
S16() |
| Modifier and Type | Method and Description |
|---|---|
static int |
compress(int[] in,
int currentPos,
int inlength,
int[] out,
int tmpoutpos)
Compress an integer array using Simple16
|
static int |
compressblock(int[] out,
int outOffset,
int[] in,
int inOffset,
int n)
Compress an integer array using Simple16
|
static int |
decompressblock(int[] out,
int outOffset,
int[] in,
int inOffset,
int n)
Decompress an integer array using Simple16
|
static int |
estimatecompress(int[] in,
int currentPos,
int inlength)
Estimate size of the compressed output.
|
static void |
uncompress(int[] in,
int tmpinpos,
int inlength,
int[] out,
int currentPos,
int outlength)
Uncompressed data from an input array into an output array
|
public static int compress(int[] in,
int currentPos,
int inlength,
int[] out,
int tmpoutpos)
in - array to compresscurrentPos - where to start readinginlength - how many integers to readout - output arraytmpoutpos - location in the output arraypublic static int estimatecompress(int[] in,
int currentPos,
int inlength)
in - array to compresscurrentPos - where to start readinginlength - how many integers to readpublic static final int compressblock(int[] out,
int outOffset,
int[] in,
int inOffset,
int n)
out - the compressed outputoutOffset - the offset of the output in the number of integersin - the integer input arrayinOffset - the offset of the input in the number of integersn - the number of elements to be compressedpublic static final int decompressblock(int[] out,
int outOffset,
int[] in,
int inOffset,
int n)
out - the decompressed outputoutOffset - the offset of the output in the number of integersin - the compressed input arrayinOffset - the offset of the input in the number of integersn - the number of elements to be compressedpublic static void uncompress(int[] in,
int tmpinpos,
int inlength,
int[] out,
int currentPos,
int outlength)
in - input array (in compressed form)tmpinpos - starting location in the compressed input arrayinlength - how much data we wish the read (in 32-bit words)out - output array (in decompressed form)currentPos - current position in the output arrayoutlength - available data in the output arrayCopyright © 2015. All Rights Reserved.