java管道流Listing1:用管道流截取控制台输出】PipedInputStreampipedIS=newPipedInputStream();PipedOutputStreampipedOS=newPipedOutputStream();try{pipedOS.connect(pipedIS);}catch(IOExceptione){System.err.println("连接失败");System.exit(1);}PrintStreamps=newPrintStream(pipedOS);System.setOut(ps);System.setErr(