Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/me/lemire/integercompression/BitPacking.java
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ protected static void fastpack9(final int[] in, int inpos,
}

/**
* Unpack 32 integers
* Pack without mask 32 integers
*
* @param in
* source array
Expand Down Expand Up @@ -3005,7 +3005,7 @@ protected static void fastpackwithoutmask9(final int[] in, int inpos,
}

/**
* Pack the 32 integers
* Unpack the 32 integers
*
* @param in
* source array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ public void uncompress(int[] inBuf, IntWrapper inPos, int inLen,
* In case you need a different way to allocate buffers, you can override this method
* with a custom behavior. The default implementation allocates a new Java direct
* {@link ByteBuffer} on each invocation.
*
* @param sizeInBytes
* @return
*/
protected ByteBuffer makeBuffer(int sizeInBytes) {
return ByteBuffer.allocateDirect(sizeInBytes);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/me/lemire/integercompression/FastPFOR.java
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ public String toString() {
* In case you need a different way to allocate buffers, you can override this method
* with a custom behavior. The default implementation allocates a new Java direct
* {@link ByteBuffer} on each invocation.
*
* @param sizeInBytes
* @return
*/
protected ByteBuffer makeBuffer(int sizeInBytes) {
return ByteBuffer.allocateDirect(sizeInBytes);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/me/lemire/integercompression/FastPFOR128.java
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ public String toString() {
* In case you need a different way to allocate buffers, you can override this method
* with a custom behavior. The default implementation allocates a new Java direct
* {@link ByteBuffer} on each invocation.
*
* @param sizeInBytes
* @return
*/
protected ByteBuffer makeBuffer(int sizeInBytes) {
return ByteBuffer.allocateDirect(sizeInBytes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public IntCompressor() {
* @throws UncompressibleInputException if the data is too poorly compressible
*/
public int[] compress(int[] input) {
int [] compressed = new int[input.length + input.length / 100 + 1024];
int[] compressed = new int[input.length + input.length / 100 + 1024];
// Store at index=0 the length of the input, hence enabling .headlessCompress
compressed[0] = input.length;
IntWrapper outpos = new IntWrapper(1);
try {
Expand All @@ -58,6 +59,7 @@ public int[] compress(int[] input) {
* @return uncompressed array
*/
public int[] uncompress(int[] compressed) {
// Read at index=0 the length of the input, hence enabling .headlessUncompress
int[] decompressed = new int[compressed[0]];
IntWrapper inpos = new IntWrapper(1);
codec.headlessUncompress(compressed, inpos,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/me/lemire/integercompression/IntegerCODEC.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public interface IntegerCODEC {
* @param in
* input array
* @param inpos
* location in the input array
* where to start reading in the array
* @param inlength
* how many integers to compress
* @param out
Expand All @@ -52,7 +52,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
* @param out
* array where to write the compressed output
* @param outpos
* where to write the compressed output in out
* where to start writing the uncompressed output in out
*/
public void uncompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* variation on the IntegerCODEC interface meant to be used for random access
* (i.e., given a large array, you can segment it and decode just the subarray you need).
*
* The main difference is that we must specify the number of integers we wish to
* decode. This information should be stored elsewhere.
* The main difference is that you must specify the number of integers you wish to
* uncompress. This information should be stored elsewhere.
*
* This interface was designed by the Terrier team for their search engine.
*
Expand All @@ -30,10 +30,13 @@ public interface SkippableIntegerCODEC {
* inpos will be incremented by 12 while outpos will be incremented by 3. We
* use IntWrapper to pass the values by reference.
*
* Implementation note: contrary to {@link IntegerCODEC#compress},
* this may skip writing information about the number of encoded integers.
*
* @param in
* input array
* @param inpos
* location in the input array
* where to start reading in the array
* @param inlength
* how many integers to compress
* @param out
Expand All @@ -57,11 +60,11 @@ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out
* @param inlength
* length of the compressed data (ignored by some schemes)
* @param out
* array where to write the compressed output
* array where to write the uncompressed output
* @param outpos
* where to write the compressed output in out
* where to start writing the uncompressed output in out
* @param num
* number of integers we want to decode, the actual number of integers decoded can be less
* number of integers we want to decode. May be less than the actual number of compressed integers
*/
public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/me/lemire/integercompression/VariableByte.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] o
* In case you need a different way to allocate buffers, you can override this method
* with a custom behavior. The default implementation allocates a new Java direct
* {@link ByteBuffer} on each invocation.
*
* @param sizeInBytes
* @return
*/
protected ByteBuffer makeBuffer(int sizeInBytes) {
return ByteBuffer.allocateDirect(sizeInBytes);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/lemire/longcompression/ByteLongCODEC.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ public void compress(long[] in, IntWrapper inpos, int inlength,
* where to write the compressed output in out
*/
public void uncompress(byte[] in, IntWrapper inpos, int inlength,
long[] out, IntWrapper outpos);
long[] out, IntWrapper outpos);

}
Loading