On Sat, 23 Apr 2022 15:24:13 GMT, Alan Bateman <al...@openjdk.org> wrote:

> > FWIW we fixed the same problem by simply using `NUL` instead of `NUL:`.
> 
> Hopefully newer code can use OutputStream.nullOutputStream(). It's portable 
> and avoids depending on these legacy Windows specific reserved names.

One possible advantage of having a "real" OS-supported `null` stream (in 
addition to its uses by the process subsystem) is that it could be used to 
efficiently drain bytes from things like sockets and pipes using transfer 
methods, assuming adequate JDK support. On Linux at least, the `splice` syscall 
is able to move bytes between socket and pipe buffers and into file buffers 
without copying them into user space. For `/dev/null` this means the bytes are 
discarded on the kernel side.

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

PR: https://git.openjdk.java.net/jdk/pull/8373

Reply via email to