public static void writeVarInt(OutputStream out,int x) throws IOException {
  while ((x & ~0x7f) != 0) {
    out.write((byte)(0x80 | (x & 0x7f)));
    x>>>=7;
  }
  out.write((byte)x);
}

public static void writeVarInt ( OutputStream out , int x ) throws IOException { while ( ( x & ~ 0x7f ) != 0 ) { out . write ( ( byte ) ( 0x80 | ( x & 0x7f ) ) ) ; x >>>= 7 ; } out . write ( ( byte ) x ) ; }
write a variable size int .
