Permalink
Browse files

Allocating more memory, to help avoid confusion

  • Loading branch information...
1 parent 38f8b91 commit eb5ce7c15faec20a89fb38805bff1babf7d243da @lemire committed Nov 25, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 example.java
View
@@ -27,7 +27,7 @@ public static void basicExample() {
new IntegratedBinaryPacking(),
new IntegratedVariableByte());
// output vector should be large enough...
- int [] compressed = new int[data.length];
+ int [] compressed = new int[data.length+1024];
// compressed might not be large enough in some cases
// if you get java.lang.ArrayIndexOutOfBoundsException, try
// allocating more memory
@@ -74,7 +74,7 @@ public static void unsortedExample() {
// throw some larger values
for(int k = 0; k < N; k+=5) data[k] = 100;
for(int k = 0; k < N; k+=533) data[k] = 10000;
- int[] compressed = new int [N];// could need more
+ int[] compressed = new int [N+1024];// could need more
IntegerCODEC codec = new
Composition(
new FastPFOR(),
@@ -124,7 +124,7 @@ public static void advancedExample() {
IntegratedIntegerCODEC lastcodec = new
IntegratedComposition(regularcodec,ivb);
// output vector should be large enough...
- int [] compressed = new int[TotalSize];
+ int [] compressed = new int[TotalSize+1024];
/**

0 comments on commit eb5ce7c

Please sign in to comment.