Could I duplicate or intercept an output stream in Java?

后端 未结 2 1768
一个人的身影
一个人的身影 2021-01-18 04:13

I want to intercept the standard output stream, then copy the content to another stream, but I also hope to keep the standard output stream like the original. Could I achiev

2条回答
  •  半阙折子戏
    2021-01-18 04:54

    Take a look at this package: org.apache.commons.io.output. I think that TeeOutputStream is what you're looking for.

提交回复
热议问题