RFR: 8155902: DataOutputStream writeInt creates 2 packets instead of 1 [v2]

Alan Bateman alanb at openjdk.org
Tue Jul 11 08:34:18 UTC 2023


On Fri, 7 Jul 2023 15:44:06 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Add a disclaimer to `java.io.DataOutputStream` to the effect that it makes no guarantee as to how the underlying output stream actually writes the bytes provided to it.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8155902: Delete "merely"

src/java.base/share/classes/java/io/DataOutputStream.java line 44:

> 42:  * the underlying output stream, hence there is no guarantee as to
> 43:  * the details of how the bytes are written.
> 44:  *

It might be better to expand the first paragraph of the class description to make it clearer that it wraps another output stream. Writing to the DOS will write bytes to the underlying output stream. That would give you the setup needed to explain that writing data that is more than one byte may result in several writes to the underlying output stream.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14791#discussion_r1259392223


More information about the core-libs-dev mailing list