On Fri, 19 Apr 2024 12:37:18 GMT, Daniel Jeliński <djelin...@openjdk.org> wrote:

>> Forget I asked this. @djelinski pointed out this is necessary to avoid 
>> having to flush at line 281. But I see that at line 686 you replaced rawout 
>> with a BufferedOutputStream - so do we still need the temporary 
>> ByteArrayOutputStream? Can't we just write directly to `ros` (possibly 
>> assert ros instanceof BufferedOutputStream if we want to make sure...)
>
> Before doing that, you might want to check the HTTPS case. As far as I can 
> tell, we don't do any buffering when SSL is in use.

I think it was safer for future enhancements the way it was done. The other 
advantage of using a BAOS over the BOS is that it has better support for 
underlying hardware that has large frames (e.g. > 64k) to limit the number of 
OS writes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18667#discussion_r1572476412

Reply via email to