Link to home
Start Free TrialLog in
Avatar of DJmistral
DJmistral

asked on

PrintStream write(String) method

void executeScript(String script, PrintStream ps) throws IOException
{
  String cmd = "source " + script;
  Process p = Runtime.getRuntime().exec(cmd);
  BufferedReader reader = new BufferedReader( new InputStreamReader( p.getInputStream() ) );

  String output = reader.readLine();

  while (output != null)
  {
    ps.write(output);
    output = reader.readLine();
  } // end while

} // end executeScript(File, PrintStream)

Any reason why "ps.write(output)" gives:
    write(java.lang.String) has private access in java.io.PrintStream
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DJmistral
DJmistral

ASKER

Doh! Thanks!