【发布时间】:2021-04-08 18:28:02
【问题描述】:
如何向 OutputStream 发送内容?
ProcessBuilder pb = new ProcessBuilder("java", "-jar", "something.jar");
Process p = pb.start();
OutputStream out = p.getOutputStream();
//Already tried this:
InputStream in = new ByteArrayInputStream(sb.toString().getBytes());
in.transferTo(out); //But this says: This method is undefined for the type: InputStream
【问题讨论】:
标签: java process io processbuilder