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

Roger Riggs rriggs at openjdk.org
Fri Jul 7 18:16:55 UTC 2023


On Fri, 7 Jul 2023 17:41:02 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> 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:  *
>> 
>> I'd drop "merely".
>> 
>> I would not want to give any assurances about whether the bytes of an encoded primitive were written individually or as a group.  
>> For the primitive types the value is encoded and written as one or more bytes to the underlying stream.
>
>> I would not want to give any assurances about whether the bytes of an encoded primitive were written individually or as a group.
> 
> Would it be helpful to add further verbiage?
> 
> For example, the sequence of bytes comprising the primitive data type may be written as more than one packet of bytes.

"packet" is network centric terminology.
Perhaps something like:  "may be written individually or in any grouping of bytes"

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

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


More information about the core-libs-dev mailing list