src/jdk.jfr/share/classes/jdk/jfr/consumer/EventStream.java
branchJEP-349-branch
changeset 57372 50ca040843ea
parent 57361 53dccc90a5be
child 57376 8e8a06a3059c
--- 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},