Solved

PrintStream write(String) method

Posted on 2004-03-27
4
880 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:DJmistral
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 50 total points
ID: 10696159
cause it is declared private :)

try instead:

ps.println(output);
0
 

Author Comment

by:DJmistral
ID: 10696202
Doh! Thanks!
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Is there a simpler dropbox system? 10 51
java mysql insert application 14 66
Website checklist for browser compatibility? 2 53
Java List 4 73
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question