This has been the cause of a royal lot of frustration.
I have two threads and a pipe between them. I want the first thread to send stdout to the second, and a pipe seemed like a convenient way to do this.
public PipedOutputStream p_stdout = new PipedOutputStream();
public PrintStream ps_stdout = new PrintStream(p_stdout, true);
System.setOut(ps_stdout);
(I've made the appropriate imports, obviously.)
The compiler (Sun Java 1.6.0.14) hates that third line.
Javadocs:
System.setOut
PipedOutputStream
PrintStream
NetBeans complains in the following manner:
cannot find symbol
symbol: class setOut
location: class java.lang.System
<identifier> expected
cannot find symbol
symbol: class ps_stdout
location: class [my project name]
<identifier> expected
Every example I've seen online uses an instantiation of PrintStream, not a class that extends it.
What gives?
Thanks in advance,
-cvp