Summary
Clarify behavior for the jdk.jfr.Recording.getStream(Instant, Instant) method when recording in memory.
Problem
The jdk.jfr.Recording.getStream() allows a user to get an InputStream to read data for a stopped recording located in the disk repository. When a recording is not to disk and data is only kept temporary in native JVM buffers, it is not possible to get an InputStream,.
Solution
If there are no disk chunks to read in the repository, null is returned. This is also what happens when a recording is in memory (not to disk). This should be documented.
Specification
* Creates a data stream for a specified interval.
* <p>
* The stream may contain some data outside the specified range.
+ * <p>
+ * If the recording is not to disk, a stream can't be created
+ * and {@code null} is returned.
*
* @param start the start time for the stream, or {@code null} to get data from
* start time of the recording
@@ -585,7 +588,7 @@ public final class Recording implements Closeable {
* present time.
*
* @return an input stream, or {@code null} if no data is available in the
- * interval.
+ * interval, or the recording was not recorded to disk
*
* @throws IllegalArgumentException if {@code end} happens before
* {@code start}
*
* @throws IOException if a stream can't be opened
+ *
+ * @see #setToDisk(boolean)
*/
- csr of
-
JDK-8252807 The jdk.jfr.Recording.getStream does not work when toDisk is disabled
- Resolved