fork(7) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Process tr = Runtime.getRuntime().exec(new String[]{"cat"});
  10. Writer wr = new OutputStreamWriter( tr.getOutputStream() );
  11. BufferedReader rd = new BufferedReader( new InputStreamReader( tr.getInputStream() ) );
  12. wr.write( "hello, world\n" );
  13. wr.flush();
  14. String s = rd.readLine();
  15. System.out.println( s );
  16. }
  17. }
Success #stdin #stdout 0.03s 246016KB
stdin
Standard input is empty
stdout
hello, world