<div dir="ltr"><div>Hi JFR dev,</div><div><br></div><div>I would like to contribute an improvement to reading JFR recordings via `InputStream` by implementing `InputStream#read(byte[], int, int)` in `ChunkInputStream` to support bulk reads and avoid many expensive single byte `read()`.</div><div><br>PR: <a href="https://github.com/openjdk/jdk/pull/20534">https://github.com/openjdk/jdk/pull/20534</a><br>Testing: `test/jdk/jdk/jfr/api/consumer/TestChunkInputStreamBulkRead.java`<br><br>While looking through some JFRs recently, I noticed some significant time spent in `java.io.BufferedInputStream#getBufIfOpen()` that traced back to transferring (via `InputStream#transferTo(OutputStream)` JFR profile recording being read via `InputStream` returned by `jdk.jfr.Recording#getStream(Instant , Instant)`. What caught my eye were calls to single byte `jdk.jfr.internal.ChunkInputStream#read()` rather than `read(byte[], int, int)` as seen in the stacktrace from JFR.<br></div><div><br></div><div>Thanks!</div></div>