private long readCompactValue() throws IOException {
    long v = dataIn.readByte();
    if (v < MIN_1BYTE_COMPACT_VALUE) {
      if (v == COMPACT_VALUE_2_TOKEN) {
        v = dataIn.readShort();
      } else {
        int bytesToRead = ((byte) v - COMPACT_VALUE_2_TOKEN) + 2;
        v = dataIn.readByte(); // note the first byte will be a signed byte.
        bytesToRead--;
        while (bytesToRead > 0) {
          v <<= 8;
          v |= dataIn.readUnsignedByte();
          bytesToRead--;
        }
      }
    }
    return v;
  }
ArchiveSplitter provides APIs to read statistic snapshots from an archive file.
geode-core/src/main/java/org/apache/geode/internal/statistics/ArchiveSplitter.java