Process类中的getOutputStream()是干嘛用的

MarkZar 2012-02-13 10:31:48
看名字,应该是取得子进程的输出流,不过看了Java官方的解释,一头雾水,怎么又和输入流扯上了?通过管道重定向到了某个进程的输入流?返回值是与子进程的正常输入相关的输出流?到底是什么流?哪位高手能解释一下?

getOutputStream

public abstract OutputStream getOutputStream()

Gets the output stream of the subprocess. Output to the stream is piped into the standard input stream of the process represented by this Process object.
Implementation note: It is a good idea for the output stream to be buffered.

Returns:

the output stream connected to the normal input of the subprocess.
...全文
564 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
MarkZar 2012-02-13
  • 打赏
  • 举报
回复

我初学Java,不过感觉这应该是一个比较基本的函数,没有人知道吗
没想到吧_ 2012-02-13
  • 打赏
  • 举报
回复
可以找个反编译跟一下代码看看。。。
MarkZar 2012-02-13
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 chianfirstli 的回复:]

getOutputStream
public abstract OutputStream getOutputStream()获取子进程的输出流。输出流被传送给由该 Process 对象表示的进程的标准输入流。
实现注意事项:对输出流进行缓冲是一个好主意。


返回:
连接到子进程正常输入的输出流。
[/Quote]
十分感谢!翻译的很到位,不过不得不说,翻译成了中文我不知道在说什么,可能实践太少,我再去试一下看看
龙腾冰 2012-02-13
  • 打赏
  • 举报
回复
getOutputStream
public abstract OutputStream getOutputStream()获取子进程的输出流。输出流被传送给由该 Process 对象表示的进程的标准输入流。
实现注意事项:对输出流进行缓冲是一个好主意。


返回:
连接到子进程正常输入的输出流。

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧