capture-output-stream:使用 AutoCloseable 从 Java 捕获 STDOUT 和 STDERR

时间:2021-06-30 05:24:03
【文件属性】:
文件名称:capture-output-stream:使用 AutoCloseable 从 Java 捕获 STDOUT 和 STDERR
文件大小:16KB
文件格式:ZIP
更新时间:2021-06-30 05:24:03
Java 捕获输出流 使用 AutoCloseable 从 Java 捕获 STDOUT 和 STDERR 概要 捕捉 import net.moznion.capture.output.stream.Capturer ; import java.io.ByteArrayOutputStream ; ByteArrayOutputStream stdout = new ByteArrayOutputStream (); ByteArrayOutputStream stderr = new ByteArrayOutputStream (); try ( Capturer capturer = new Capturer (stdout, stderr)) { System . out . print( " hello " ); // <= don't print anything
【文件预览】:
capture-output-stream-master
----.gitignore(299B)
----src()
--------main()
--------test()
----.travis.yml(90B)
----pom.xml(5KB)
----README.md(3KB)

网友评论