Index: src/java/org/apache/lucene/store/IndexInput.java
===================================================================
--- src/java/org/apache/lucene/store/IndexInput.java	(revision 904068)
+++ src/java/org/apache/lucene/store/IndexInput.java	(working copy)
@@ -67,6 +67,13 @@
     readBytes(b, offset, len);
   }
 
+  /** Reads two bytes of an unsigned 16 bit integer and returns an int.
+   * @see IndexOutput#writeShort(int)
+   */
+  public int readShort() throws IOException {
+    return ((readByte() & 0xFF) <<  8) |  (readByte() & 0xFF);
+  }
+
   /** Reads four bytes and returns an int.
    * @see IndexOutput#writeInt(int)
    */
@@ -75,7 +82,7 @@
          | ((readByte() & 0xFF) <<  8) |  (readByte() & 0xFF);
   }
 
-  /** Reads an int stored in variable-length format.  Reads between one and
+  /** Reads an int stored in variable byte length format.  Reads between one and
    * five bytes.  Smaller values take fewer bytes.  Negative numbers are not
    * supported.
    * @see IndexOutput#writeVInt(int)
@@ -90,6 +97,27 @@
     return i;
   }
 
+  /** Reads an int stored in variable short length format.  Reads two, four
+   * or six bytes.  Smaller values take fewer bytes.  Negative numbers are not
+   * supported.
+   * @see IndexOutput#writeVShortInt(int)
+   */
+  public int readVShortInt() throws IOException {
+    int s = readShort();
+    int i = s & 0x7FFF;
+    if ((s & 0x8000) == 0) {
+      return i;
+    }
+    s = readShort();
+    i |= (s & 0x7FFF) << 15;
+    if ((s & 0x8000) == 0) {
+      return i;
+    }
+    s = readShort();
+    assert (s & 0xFFFFFFFE) == 0; // only 31st bit, negative numbers not supported
+    return i | ((s & 0x7FFF) << 30);
+  }
+
   /** Reads eight bytes and returns a long.
    * @see IndexOutput#writeLong(long)
    */
Index: src/java/org/apache/lucene/store/IndexOutput.java
===================================================================
--- src/java/org/apache/lucene/store/IndexOutput.java	(revision 904068)
+++ src/java/org/apache/lucene/store/IndexOutput.java	(working copy)
@@ -53,6 +53,14 @@
    */
   public abstract void writeBytes(byte[] b, int offset, int length) throws IOException;
 
+  /** Writes the lower 16 bits of an int as two bytes.
+   * @see IndexInput#readShort()
+   */
+  public void writeShort(int i) throws IOException {
+    writeByte((byte)(i >> 8));
+    writeByte((byte) i);
+  }
+
   /** Writes an int as four bytes.
    * @see IndexInput#readInt()
    */
@@ -63,19 +71,32 @@
     writeByte((byte) i);
   }
 
-  /** Writes an int in a variable-length format.  Writes between one and
+  /** Writes an int in a variable byte length format.  Writes between one and
    * five bytes.  Smaller values take fewer bytes.  Negative numbers are not
    * supported.
    * @see IndexInput#readVInt()
    */
   public void writeVInt(int i) throws IOException {
     while ((i & ~0x7F) != 0) {
-      writeByte((byte)((i & 0x7f) | 0x80));
+      writeByte((byte)((i & 0x7F) | 0x80));
       i >>>= 7;
     }
     writeByte((byte)i);
   }
 
+  /** Writes an int in a variable short length format.  Writes two, four or
+   * six bytes.  Smaller values take fewer bytes.  Negative numbers are not
+   * supported.
+   * @see IndexInput#readVShortInt()
+   */
+  public void writeVShortInt(int i) throws IOException {
+    while ((i & ~0x7FFF) != 0) {
+      writeShort((i & 0x7FFF) | 0x8000);
+      i >>>= 15;
+    }
+    writeShort(i);
+  }
+
   /** Writes a long as eight bytes.
    * @see IndexInput#readLong()
    */
@@ -84,7 +105,7 @@
     writeInt((int) i);
   }
 
-  /** Writes an long in a variable-length format.  Writes between one and five
+  /** Writes an long in a variable-length format.  Writes between one and nine
    * bytes.  Smaller values take fewer bytes.  Negative numbers are not
    * supported.
    * @see IndexInput#readVLong()
Index: src/java/org/apache/lucene/index/FormatPostingsPositionsWriter.java
===================================================================
--- src/java/org/apache/lucene/index/FormatPostingsPositionsWriter.java	(revision 904068)
+++ src/java/org/apache/lucene/index/FormatPostingsPositionsWriter.java	(working copy)
@@ -60,14 +60,15 @@
     if (storePayloads) {
       if (payloadLength != lastPayloadLength) {
         lastPayloadLength = payloadLength;
-        out.writeVInt((delta<<1)|1);
+        out.writeVShortInt((delta<<1)|1);
         out.writeVInt(payloadLength);
       } else
-        out.writeVInt(delta << 1);
+        out.writeVShortInt(delta << 1);
       if (payloadLength > 0)
         out.writeBytes(payload, payloadLength);
-    } else
-      out.writeVInt(delta);
+    } else {
+      out.writeVShortInt(delta);
+    }
   }
 
   void setField(FieldInfo fieldInfo) {
Index: src/java/org/apache/lucene/index/SegmentTermPositions.java
===================================================================
--- src/java/org/apache/lucene/index/SegmentTermPositions.java	(revision 904068)
+++ src/java/org/apache/lucene/index/SegmentTermPositions.java	(working copy)
@@ -72,7 +72,7 @@
   }
 
   private final int readDeltaPosition() throws IOException {
-    int delta = proxStream.readVInt();
+    int delta = proxStream.readVShortInt();
     if (currentFieldStoresPayloads) {
       // if the current field stores payloads then
       // the position delta is shifted one bit to the left.
