PipedInputStream和PipedOutputStream的用例 [英] Use cases of PipedInputStream and PipedOutputStream

查看:109
本文介绍了PipedInputStream和PipedOutputStream的用例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Piped流的用例是什么?为什么不将数据读入缓冲区然后将其写出来?

解决方案

使用Piped流的一个优点是它们在我们的代码中提供流功能,而不会迫使我们构建新的专用流。



例如我们可以使用管道为我们的应用程序创建简单的日志记录工具。我们可以通过普通的Printwritter向日志工具发送消息,然后它可以做任何处理或缓冲,然后再将消息发送到最终目的地。 / p>

更多详情请参阅: http://docstore.mik.ua/orelly/java/exp/ch08_01.htm


What are use cases of Piped streams? Why just not read data into buffer and then write them out?

解决方案

One advantage of using Piped streams is that they provide stream functionality in our code without compelling us to build new specialized streams.

For e.g. we can use pipes to create simple logging facility for our application.We can send messages to logging facility through ordinaty Printwritter and then it can do whatever processing or buffering is required before sending message off to final destination.

more details refer : http://docstore.mik.ua/orelly/java/exp/ch08_01.htm

这篇关于PipedInputStream和PipedOutputStream的用例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆