public static long readUnsignedVL(DataInput in) throws IOException {
  int shift=0;
  long result=0;
  while (shift < 64) {
    final byte b=in.readByte();
    result|=(long)(b & 0x7F) << shift;
    if ((b & 0x80) == 0) {
      return result;
    }
    shift+=7;
  }
  throw new GemFireIOException("Malformed variable length integer");
}

public static long readUnsignedVL ( DataInput in ) throws IOException { int shift = 0 ; long result = 0 ; while ( shift < 64 ) { final byte b = in . readByte ( ) ; result |= ( long ) ( b & 0x7F ) << shift ; if ( ( b & 0x80 ) == 0 ) { return result ; } shift += 7 ; } throw new GemFireIOException ( "Malformed variable length integer" ) ; }
decode a long as a variable length array . this is taken from the varint encoding in protobufs ( bsd licensed ) . see https : / / developers . google . com / protocol - buffers / docs / encoding
