private boolean readToken() throws IOException {
    byte token;
    try {
      token = dataIn.readByte();
      switch (token) {
        case HEADER_TOKEN:
          readHeaderToken();
          myIs.putBytes(dataOut);
          break;
        case RESOURCE_TYPE_TOKEN:
          readResourceTypeToken();
          myIs.putBytes(dataOut);
          break;
        case RESOURCE_INSTANCE_CREATE_TOKEN:
        case RESOURCE_INSTANCE_INITIALIZE_TOKEN:
          readResourceInstanceCreateToken(token == RESOURCE_INSTANCE_INITIALIZE_TOKEN);
          myIs.putBytes(dataOut);
          break;
        case RESOURCE_INSTANCE_DELETE_TOKEN:
          readResourceInstanceDeleteToken();
          myIs.putBytes(dataOut);
          break;
        case SAMPLE_TOKEN:
          readSampleToken();
          myIs.putBytes(dataOut);
          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/ArchiveSplitter.java