private boolean readToken() throws IOException {
      byte token;
      try {
        if (updateOK) {
          dataIn.mark(BUFFER_SIZE);
        }
        token = dataIn.readByte();
        switch (token) {
          case HEADER_TOKEN:
            readHeaderToken();
            break;
          case RESOURCE_TYPE_TOKEN:
            readResourceTypeToken();
            break;
          case RESOURCE_INSTANCE_CREATE_TOKEN:
            readResourceInstanceCreateToken(false);
            break;
          case RESOURCE_INSTANCE_INITIALIZE_TOKEN:
            readResourceInstanceCreateToken(true);
            break;
          case RESOURCE_INSTANCE_DELETE_TOKEN:
            readResourceInstanceDeleteToken();
            break;
          case SAMPLE_TOKEN:
            readSampleToken();
            break;
          default:
            throw new IOException(String.format("Unexpected token byte value: %s",
                token));
        }
        return true;
      } catch (EOFException ignore) {
        return false;
      }
    }
Returns true if token read, false if eof.
geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveReader.java