private void readSampleToken() throws IOException {
    readTimeDelta();
    int resourceInstId = readResourceInstId();
    while (resourceInstId != ILLEGAL_RESOURCE_INST_ID) {
      byte[] typeCodes = resourceInstanceTypeCodes[resourceInstId];
      long[] bits = resourceInstanceBits[resourceInstId];
      int statOffset = dataIn.readUnsignedByte();
      while (statOffset != ILLEGAL_STAT_OFFSET) {
        long statDeltaBits;
        switch (typeCodes[statOffset]) {
          case BOOLEAN_CODE:
          case BYTE_CODE:
          case CHAR_CODE:
            statDeltaBits = dataIn.readByte();
            break;
          case WCHAR_CODE:
            statDeltaBits = dataIn.readUnsignedShort();
            break;
          case SHORT_CODE:
            statDeltaBits = dataIn.readShort();
            break;
          case INT_CODE:
          case FLOAT_CODE:
          case LONG_CODE:
          case DOUBLE_CODE:
            statDeltaBits = readCompactValue();
            break;
          default:
            throw new IOException(String.format("unexpected typeCode value %s",
                typeCodes[statOffset]));
        }
        bits[statOffset] += statDeltaBits;
        statOffset = dataIn.readUnsignedByte();
      }
      resourceInstId = readResourceInstId();
    }
  }
ArchiveSplitter provides APIs to read statistic snapshots from an archive file.
geode-core/src/main/java/org/apache/geode/internal/statistics/ArchiveSplitter.java