docs: static void writeMillis(DataOutput out, long millis) throws IOException {
          if (millis % (30 * 60000L) == 0) {
              // Try to write in 30 minute units.
              long units = millis / (30 * 60000L);
              if (((units << (64 - 6)) >> (64 - 6)) == units) {
                  // Form 00 (6 bits effective precision)
                  out.writeByte((int)(units & 0x3f));
                  return;
              }
          }
  
          if (millis % 60000L == 0) {
              // Try to write minutes.
              long minutes = millis / 60000L;
              if (((minutes << (64 - 30)) >> (64 - 30)) == minutes) {
                  // Form 01 (30 bits effective precision)
                  out.writeInt(0x40000000 | (int)(minutes & 0x3fffffff));
                  return;
              }
          }
          
          if (millis % 1000L == 0) {
              // Try to write seconds.
              long seconds = millis / 1000L;
              if (((seconds << (64 - 38)) >> (64 - 38)) == seconds) {
                  // Form 10 (38 bits effective precision)
                  out.writeByte(0x80 | (int)((seconds >> 32) & 0x3f));
                  out.writeInt((int)(seconds & 0xffffffff));
                  return;
              }
          }
  
          // Write milliseconds either because the additional precision is
          // required or the minutes didn't fit in the field.
          
          // Form 11 (64-bits effective precision, but write as if 70 bits)
          out.writeByte(millis < 0 ? 0xff : 0xc0);
          out.writeLong(millis);
      }