code: static public void packLong(OutputStream out, long value) throws IOException {
          //$DELAY$
          int shift = 63-Long.numberOfLeadingZeros(value);
          shift -= shift%7; // round down to nearest multiple of 7
          while(shift!=0){
              out.write((int) ((value>>>shift) & 0x7F));
              //$DELAY$
              shift-=7;
          }
          out.write((int) ((value & 0x7F)|0x80));
      }
docs: Pack long into output.
  It will occupy 1-10 bytes depending on value (lower values occupy smaller space)
  
  @param out OutputStream to put value into
  @param value to be serialized, must be non-negative
  
  @throws java.io.IOException in case of IO error