<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <br>
    <br>
    <div class="moz-cite-prefix">On 27/10/2025 11:47, Pavel Rappo wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:CAChcVunevSwUqNXrZZCy3-CEhA8=oqQ0qVvOHOkARCUgaeGmfg@mail.gmail.com">
      <pre wrap="" class="moz-quote-pre">The specification of the read/write methods, their classes, and the
package is silent on multithreading. In which case you should always
assume that the methods are **not** thread-safe.</pre>
    </blockquote>
    Right, although there are some APIs that do specify that input or
    output streams are safe for used by concurrent threads, e.g. the
    input/output streams returned by the Channels class that support
    interop between channels and input/output streams.<br>
    <br>
    Another more subtle aspect to the topic is async close. With many
    input/output streams it doesn't make any sense to attempt to use
    them from concurrent threads but async close when there is a blocker
    read/writer is something that has to be supported in some cases.<br>
    <br>
    In any access, I read <span style="white-space: pre-wrap">Florian</span>'s
    mail as asking something else. I read the mail as concurrent access
    to the byte[], e.g. someone flipping bytes while someone is calling
    write.<br>
    <br>
    -Alan<br>
  </body>
</html>