private void writeHeader(long initialDate, StatArchiveDescriptor archiveDescriptor) {
    if (logger.isTraceEnabled(LogMarker.STATISTICS_VERBOSE)) {
      logger.trace(LogMarker.STATISTICS_VERBOSE,
          "StatArchiveWriter#writeHeader initialDate={} archiveDescriptor={}", initialDate,
          archiveDescriptor);
    }
    try {
      dataOut.writeByte(HEADER_TOKEN);
      dataOut.writeByte(ARCHIVE_VERSION);
      dataOut.writeLong(initialDate);
      dataOut.writeLong(archiveDescriptor.getSystemId());
      dataOut.writeLong(archiveDescriptor.getSystemStartTime());
      TimeZone timeZone = getTimeZone();
      dataOut.writeInt(timeZone.getRawOffset());
      dataOut.writeUTF(timeZone.getID());
      dataOut.writeUTF(archiveDescriptor.getSystemDirectoryPath());
      dataOut.writeUTF(archiveDescriptor.getProductDescription());
      dataOut.writeUTF(getOSInfo());
      dataOut.writeUTF(getMachineInfo());

      if (trace) {
        traceDataOut.println("writeHeader traceStatisticsName: " + traceStatisticsName);
        traceDataOut
            .println("writeHeader traceStatisticsTypeName: " + traceStatisticsTypeName);
        traceDataOut.println("writeHeader#writeByte HEADER_TOKEN: " + HEADER_TOKEN);
        traceDataOut.println("writeHeader#writeByte ARCHIVE_VERSION: " + ARCHIVE_VERSION);
        traceDataOut.println("writeHeader#writeLong initialDate: " + initialDate);
        traceDataOut.println("writeHeader#writeLong archiveDescriptor.getSystemId(): "
            + archiveDescriptor.getSystemId());
        traceDataOut.println("writeHeader#writeLong archiveDescriptor.getSystemStartTime(): "
            + archiveDescriptor.getSystemStartTime());
        traceDataOut
            .println("writeHeader#writeInt timeZone.getRawOffset(): " + timeZone.getRawOffset());
        traceDataOut.println("writeHeader#writeUTF timeZone.getID(): " + timeZone.getID());
        traceDataOut
            .println("writeHeader#writeUTF archiveDescriptor.getSystemDirectoryPath(): "
                + archiveDescriptor.getSystemDirectoryPath());
        traceDataOut.println("writeHeader#writeUTF archiveDescriptor.getProductDescription(): "
            + archiveDescriptor.getProductDescription());
        traceDataOut.println("writeHeader#writeUTF getOSInfo(): " + getOSInfo());
        traceDataOut.println("writeHeader#writeUTF getMachineInfo(): " + getMachineInfo());
      }
    } catch (IOException ex) {
      throw new GemFireIOException(
          "Failed writing header to statistic archive",
          ex);
    }
  }
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