public static long readVLOld(DataInput in) throws IOException {
  byte code=in.readByte();
  long result;
  if (code < 0) {
    result=code & 0x7F;
    result<<=8;
    result|=in.readByte() & 0xFF;
  }
 else   if (code <= MAX_BYTE_VL) {
    result=code;
  }
 else   if (code == INT_VL) {
    result=in.readInt();
  }
 else   if (code == LONG_VL) {
    result=in.readLong();
  }
 else {
    throw new IllegalStateException("unexpected variable length code=" + code);
  }
  return result;
}

public static long readVLOld ( DataInput in ) throws IOException { byte code = in . readByte ( ) ; long result ; if ( code < 0 ) { result = code & 0x7F ; result <<= 8 ; result |= in . readByte ( ) & 0xFF ; } else if ( code <= MAX_BYTE_VL ) { result = code ; } else if ( code == INT_VL ) { result = in . readInt ( ) ; } else if ( code == LONG_VL ) { result = in . readLong ( ) ; } else { throw new IllegalStateException ( "unexpected variable length code=" + code ) ; } return result ; }
write a variable length long the old way ( pre 7 . 0 ) . use this only in contexts where you might need to communicate with pre 7 . 0 members or files .
