diff -r 1da8552f0b59 -r 596f839ce88f src/jdk.jfr/share/classes/jdk/jfr/consumer/ChunkParser.java --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/ChunkParser.java Tue Jun 25 12:03:01 2019 +0200 +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/ChunkParser.java Tue Jun 25 13:32:03 2019 +0200 @@ -66,10 +66,13 @@ private boolean resetEventCache; public ChunkParser(RecordingInput input, boolean reuse) throws IOException { - this(new ChunkHeader(input), null, 500); + this(new ChunkHeader(input), null, 500); this.reuse = reuse; } + public ChunkParser(ChunkParser previous) throws IOException { + this(new ChunkHeader(previous.input), null, 500); + } private ChunkParser(ChunkHeader header, ChunkParser previous, long pollInterval) throws IOException { this.input = header.getInput(); @@ -334,6 +337,10 @@ return chunkHeader.isLastChunk(); } + public ChunkParser newChunkParser() throws IOException { + return new ChunkParser(this); + } + public ChunkParser nextChunkParser() throws IOException { return new ChunkParser(chunkHeader.nextHeader(), this, pollInterval); }