RFR: 8367943: PipedOutputStream write(0, 0) successful after close() [v2]

Alan Bateman alanb at openjdk.org
Sat Nov 1 08:29:05 UTC 2025


On Fri, 31 Oct 2025 16:27:57 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Update the specification of `java.io.PipedOutputStream.write(byte[],int,int)` to match longstanding behavior. Add a verification to an existing test.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8367943: positive -> greater than zero

src/java.base/share/classes/java/io/PipedOutputStream.java line 132:

> 130:      * Writes {@code len} bytes from the specified byte array
> 131:      * starting at offset {@code off} to this piped output stream.
> 132:      * This method blocks until all the bytes are written to the output

To align the spec with long standing behavior then I think this sentence needs to be adjusted to say that if len is not zero, then it blocks until all bytes are written.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28078#discussion_r2483195548


More information about the core-libs-dev mailing list