private void writeResourceInst(int instId) throws IOException {
    if (logger.isTraceEnabled(LogMarker.STATISTICS_VERBOSE)) {
      logger.trace(LogMarker.STATISTICS_VERBOSE, "StatArchiveWriter#writeResourceInst instId={}",
          instId);
    }
    if (instId > MAX_BYTE_RESOURCE_INST_ID) {
      if (instId > MAX_SHORT_RESOURCE_INST_ID) {
        dataOut.writeByte(INT_RESOURCE_INST_ID_TOKEN);
        dataOut.writeInt(instId);
        if (trace && (traceResourceInstId == -1 || traceResourceInstId == instId)) {
          traceDataOut.println("writeResourceInst#writeByte INT_RESOURCE_INST_ID_TOKEN: "
              + INT_RESOURCE_INST_ID_TOKEN);
          traceDataOut.println("writeResourceInst#writeInt instId: " + instId);
        }
      } else {
        dataOut.writeByte(SHORT_RESOURCE_INST_ID_TOKEN);
        dataOut.writeShort(instId);
        if (trace && (traceResourceInstId == -1 || traceResourceInstId == instId)) {
          traceDataOut.println("writeResourceInst#writeByte SHORT_RESOURCE_INST_ID_TOKEN: "
              + SHORT_RESOURCE_INST_ID_TOKEN);
          traceDataOut.println("writeResourceInst#writeShort instId: " + instId);
        }
      }
    } else {
      dataOut.writeByte(instId);
      if (trace && (traceResourceInstId == -1 || traceResourceInstId == instId)) {
        if (instId == ILLEGAL_RESOURCE_INST_ID) {
          traceDataOut.println(
              "writeResourceInst#writeByte ILLEGAL_RESOURCE_INST_ID: " + ILLEGAL_RESOURCE_INST_ID);
        } else {
          traceDataOut.println("writeResourceInst#writeByte instId: " + instId);
        }
      }
    }
  }
Writes the resource instance id to the <code>dataOut</code> stream.
geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveWriter.java