code: public static void writeVarLongCount(DataOutput out, long val) throws IOException {
  		if (val < 0) {
  			throw new IOException("Illegal count (must be non-negative): " + val);
  		}
  
  		while ((val & ~0x7FL) != 0) {
  			out.write(((int) val) | 0x80);
  			val >>>= 7;
  		}
  		out.write((int) val);
  	}
docs: --------------------------------------------------------------------------------------------