Index: C:/Home/jstuyts/dev/wsp/hippo/Lucene/src/java/org/apache/lucene/store/IndexInput.java =================================================================== --- C:/Home/jstuyts/dev/wsp/hippo/Lucene/src/java/org/apache/lucene/store/IndexInput.java (revision 425666) +++ C:/Home/jstuyts/dev/wsp/hippo/Lucene/src/java/org/apache/lucene/store/IndexInput.java (working copy) @@ -55,9 +55,21 @@ public int readVInt() throws IOException { byte b = readByte(); int i = b & 0x7F; - for (int shift = 7; (b & 0x80) != 0; shift += 7) { + if (b < 0) { b = readByte(); - i |= (b & 0x7F) << shift; + i |= (b & 0x7F) << 7; + if (b < 0) { + b = readByte(); + i |= (b & 0x7F) << 14; + if (b < 0) { + b = readByte(); + i |= (b & 0x7F) << 21; + if (b < 0) { + b = readByte(); + i |= (b & 0x7F) << 28; + } + } + } } return i; }