P
Paul Gessos
Why this code not working?
byte[] buf = new byte[10000];
Process p = Runtime.getRuntime().exec("php -n 1.php");
p.getErrorStream().close();
InputStream is = p.getInputStream();
OutputStream os = p.getOutputStream();
os.write("write serialized data...".getBytes());// never takes data
p.waitFor();
int count = is.read(buf); // count == -1
System.out.println(buf); // write garbage
System.exit(0);
byte[] buf = new byte[10000];
Process p = Runtime.getRuntime().exec("php -n 1.php");
p.getErrorStream().close();
InputStream is = p.getInputStream();
OutputStream os = p.getOutputStream();
os.write("write serialized data...".getBytes());// never takes data
p.waitFor();
int count = is.read(buf); // count == -1
System.out.println(buf); // write garbage
System.exit(0);