Is there a Null OutputStream in Java?

前端 未结 11 658
灰色年华
灰色年华 2020-12-08 13:04

I need to specify an OutputStream for an API I\'m using, but I don\'t actually have a need for the output. Does Java have an OutputStream equivale

11条回答
  •  情深已故
    2020-12-08 13:45

    I believe that this is what you're looking for, I was looking for the same thing: This is for redirecting output streams from standard error, standard out in ProcessBuilder objects.

    Blockquote

    pb.redirectError( ProcessBuilder.Redirect.appendTo( new File( "NUL:" ) ) );
    
    • Dom

提交回复
热议问题