private void readResourceInstanceCreateToken(boolean initialize) throws IOException {
    int resourceInstId = dataIn.readInt();
    skipUTF(); // String name = dataIn.readUTF();
    skipLong(); // long id = dataIn.readLong();
    int resourceTypeId = dataIn.readInt();

    if (resourceInstId >= resourceInstanceBits.length) {
      long[][] tmpBits = new long[resourceInstId + 128][];
      System.arraycopy(resourceInstanceBits, 0, tmpBits, 0, resourceInstanceBits.length);
      resourceInstanceBits = tmpBits;

      byte[][] tmpTypeCodes = new byte[resourceInstId + 128][];
      System.arraycopy(resourceInstanceTypeCodes, 0, tmpTypeCodes, 0,
          resourceInstanceTypeCodes.length);
      resourceInstanceTypeCodes = tmpTypeCodes;

      byte[][] tmpTokens = new byte[resourceInstId + 128][];
      System.arraycopy(resourceInstanceTokens, 0, tmpTokens, 0, resourceInstanceTokens.length);
      resourceInstanceTokens = tmpTokens;
    }
    byte[] instTypeCodes = resourceTypes[resourceTypeId];
    resourceInstanceTypeCodes[resourceInstId] = instTypeCodes;
    resourceInstanceTokens[resourceInstId] = myIs.getBytes();
    resourceInstanceTokens[resourceInstId][0] = RESOURCE_INSTANCE_INITIALIZE_TOKEN;
    long[] instBits = new long[instTypeCodes.length];
    resourceInstanceBits[resourceInstId] = instBits;
    if (initialize) {
      for (int i = 0; i < instBits.length; i++) {
        switch (instTypeCodes[i]) {
          case BOOLEAN_CODE:
          case BYTE_CODE:
          case CHAR_CODE:
            instBits[i] = dataIn.readByte();
            break;
          case WCHAR_CODE:
            instBits[i] = dataIn.readUnsignedShort();
            break;
          case SHORT_CODE:
            instBits[i] = dataIn.readShort();
            break;
          case INT_CODE:
          case FLOAT_CODE:
          case LONG_CODE:
          case DOUBLE_CODE:
            instBits[i] = readCompactValue();
            break;
          default:
            throw new IOException(String.format("unexpected typeCode value %s",
                instTypeCodes[i]));
        }
      }
    }
  }
ArchiveSplitter provides APIs to read statistic snapshots from an archive file.
geode-core/src/main/java/org/apache/geode/internal/statistics/ArchiveSplitter.java