Fork me on GitHub

java-使用管道流进行线程间通信

 使用管道流进行通信

以内存为媒介,用于线程之间的数据传输。

主要有面向字节:【PipedOutputStream、PipedInputStream】

面向字符【PipedReader、PipedWriter】

代码

读线程类:

 测试类

 结果:

 源代码地址:https://github.com/woxbwo/is-concurrent

 完成!!!

posted @ 2019-09-03 01:30  xbwang520  阅读(231)  评论(0编辑  收藏  举报