Is there a Null OutputStream in Java?

前端 未结 11 603
灰色年华
灰色年华 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:32

    Java doesn't it would seem but Apache Commons IO does. Take a look at the following:

    https://commons.apache.org/proper/commons-io/javadocs/api-2.5/org/apache/commons/io/output/NullOutputStream.html

    Hope that helps.

提交回复
热议问题