Module jdk.jfr

Class RecordingFile

java.lang.Object
jdk.jfr.consumer.RecordingFile
All Implemented Interfaces:
Closeable, AutoCloseable

public final class RecordingFile extends Object implements Closeable
A recording file.

The following example shows how read and print all events in a recording file.

try (RecordingFile recordingFile = new RecordingFile(Paths.get("recording.jfr"))) {
    while (recordingFile.hasMoreEvents()) {
        RecordedEvent event = recordingFile.readEvent();
        System.out.println(event);
    }
}
Since:
9