Java.io.PipedOutputStream and java.io.PipedInputStream has been introduced in JDK 1.0. PipedOutputStream and PipedInputStream both are connected to each other to create a communication pipe. PipedOutputStream is the sending end and PipedOutputStream is the receiving end of the pipe. Both ends should not be handled by single thread otherwise deadlock may occur. If any thread stops working, pipe is said to be broken.
最好不要在一个线程中使用,可能会发生死锁。
如果有任一个线程停止工作或发生异常,管道就会被破坏,不能正常的发送或接收。
实例1:线程池使用
import java.io.IOExc