diff -r 29635339ef62 -r 50ca040843ea src/jdk.jfr/share/classes/jdk/jfr/consumer/EventStream.java --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventStream.java Tue May 21 22:59:47 2019 +0200 +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventStream.java Fri May 24 19:39:31 2019 +0200 @@ -28,6 +28,7 @@ import java.io.IOException; import java.nio.file.Path; import java.time.Duration; +import java.time.Instant; import java.util.function.Consumer; /** @@ -53,6 +54,8 @@ * * @param file location of the file, not {@code null} * @return an event stream, not {@code null} + * + * @throws IOException if a stream can't be opened,or an I/O error occurs during reading */ public static EventStream openFile(Path file) throws IOException { throw new UnsupportedOperationException("Not yet implemented"); @@ -60,6 +63,29 @@ } /** + * Creates an event stream starting start time and end time in a file. + * + * @param file location of the file, not {@code null} + * + * @param the start start time for the stream, or {@code null} to get data from + * the beginning of the + * + * @param the end end time for the stream, or {@code null} to get data until the + * end. + * + * @throws IllegalArgumentException if {@code end} happens before + * {@code start} + * + * @throws IOException if a stream can't be opened,or an I/O error occurs during reading + */ + public static EventStream openFile(Path file, Instant from, Instant to) throws IOException { + throw new UnsupportedOperationException("Not yet implemented"); +// return new EventFileStream(file); + } + + + + /** * Performs an action on all events in the stream. * * @param action an action to be performed on each {@code RecordedEvent},