Answer the question
In order to leave comments, you need to log in
How to write to the outgoing for the parent (incoming for the child) stream in ProcessBildere in java?
jaba
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class test {
public static void main(String args[]) throws Exception {
Process pb = new ProcessBuilder().command("php", "php.php", "123").start();
BufferedReader in = new BufferedReader(new InputStreamReader(pb.getInputStream()));
PrintWriter out = new PrintWriter(pb.getOutputStream());
Thread.sleep(1000);
out.println("321\r\n\r\n");
System.out.println(in.readLine());
System.out.println(in.readLine());
System.out.println(in.readLine());
System.out.println(in.readLine());
System.out.println(in.readLine());
}
}
<?
$f = fopen("php://stdin","r+");
$read = fread($f,4096);
$read = str_replace("\r\n","",$read);
fclose($f);
echo "3331\n";
echo $argv[1]."\n";
echo "3332\n";
echo $read."\n";
echo "3333\n";
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question