On 5/11/06, Marvin Humphrey <[EMAIL PROTECTED]> wrote:
I believe that this is possible if we change the definition of VInt
so that the high bytes are written first, rather than the low bytes.
The "BER compressed integer"

Great idea Marvin!  The decoding could be slightly faster with
reverse-byte order since you don't have to maintain a shift-count:

 public int readVInt() throws IOException {
   byte b = readByte();
   int i = b & 0x7F;
   while ((b & 0x80)!=0)
     b = readByte();
     i = (i<<7) | (b & 0x7F);
   }
   return i;
 }

Of course there is that *little* detail of backward compatability ;-)

-Yonik

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to