On 27/10/2025 11:47, Pavel Rappo wrote:
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.
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.

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.

In any access, I read Florian'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.

-Alan

Reply via email to