Can Java Runtime.exec another java program that uses stdin?

拜拜、爱过 提交于 2019-12-02 08:05:45

Call the method Process.getOutputStream and feed your input to the returned output stream.

api docs:

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!