Index: lucene/src/test/org/apache/lucene/index/codecs/simple64/Simple64VarIntTest.java =================================================================== --- lucene/src/test/org/apache/lucene/index/codecs/simple64/Simple64VarIntTest.java (revision 1067253) +++ lucene/src/test/org/apache/lucene/index/codecs/simple64/Simple64VarIntTest.java (working copy) @@ -62,7 +62,7 @@ throws IOException { final RAMDirectory dir = new RAMDirectory(); final String filename = Simple64.class.toString(); - final IntStreamFactory factory = new Simple64VarIntCodec().getIntFactory(); + final IntStreamFactory factory = new Simple64VarIntCodec(_TestUtil.nextInt(random, 1, 4)).getIntFactory(); final IntIndexOutput output = factory.createOutput(dir, filename); if (VERBOSE) { Index: lucene/src/java/org/apache/lucene/index/codecs/simple64/Simple64VarIntCodec.java =================================================================== --- lucene/src/java/org/apache/lucene/index/codecs/simple64/Simple64VarIntCodec.java (revision 1067253) +++ lucene/src/java/org/apache/lucene/index/codecs/simple64/Simple64VarIntCodec.java (working copy) @@ -18,6 +18,8 @@ */ import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.LongBuffer; import java.util.Set; import org.apache.lucene.index.SegmentInfo; @@ -52,9 +54,11 @@ */ public class Simple64VarIntCodec extends Codec { + private final int multiplier; - public Simple64VarIntCodec() { + public Simple64VarIntCodec(int multiplier) { name = "Simple64VarInt"; + this.multiplier = multiplier; } @Override @@ -76,9 +80,17 @@ @Override protected BlockReader getBlockReader(final IndexInput in, final int[] buffer) throws IOException { return new BlockReader() { + private final ByteBuffer nioBuffer = ByteBuffer.allocate(multiplier * 8); + private final byte[] byteBuffer = nioBuffer.array(); + private final LongBuffer longBuffer = nioBuffer.asLongBuffer(); public int readBlock() throws IOException { //System.out.println("S64.readBlock in.fp=" + in.getFilePointer()); - int count = Simple64.decompressSingle(in.readLong(), buffer, 0); + int count = 0; + in.readBytes(byteBuffer, 0, 8*multiplier); + longBuffer.rewind(); + for(int i=0;i