private void writeTimeStamp(long nanosTimeStamp) throws IOException {
    final long millisTimeStamp = NanoTimer.nanosToMillis(nanosTimeStamp);
    final long delta = calcDelta(previousMillisTimeStamp, millisTimeStamp);
    if (logger.isTraceEnabled(LogMarker.STATISTICS_VERBOSE)) {
      logger.trace(LogMarker.STATISTICS_VERBOSE,
          "StatArchiveWriter#writeTimeStamp millisTimeStamp={}, delta={}", millisTimeStamp,
          (int) delta);
    }
    if (delta > MAX_SHORT_TIMESTAMP) {
      if (delta > Integer.MAX_VALUE) {
        throw new InternalGemFireException(
            String.format("timeStamp delta %s was greater than %s",

                delta, Integer.MAX_VALUE));
      }
      dataOut.writeShort(INT_TIMESTAMP_TOKEN);
      dataOut.writeInt((int) delta);
      if (trace) {
        traceDataOut
            .println("writeTimeStamp#writeShort INT_TIMESTAMP_TOKEN: " + INT_TIMESTAMP_TOKEN);
        traceDataOut.println("writeTimeStamp#writeInt (int)delta: " + (int) delta);
      }
    } else {
      dataOut.writeShort((int) delta);
      if (trace) {
        traceDataOut.println("writeTimeStamp#writeShort (int)delta: " + (int) delta);
      }
    }
    previousMillisTimeStamp = millisTimeStamp;
  }
Returns the number of bytes written so far to this archive. This does not take compression into
account.
geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveWriter.java