|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
jpiv2.SystemOutStream
public class SystemOutStream
This class is used to copy system output to a jpiv2.CmdFrame.
To catch the System output, do someting like this:
// creating a new CmdFrame
cmdFrame = new jpiv2.CmdFrame(this);
// creating a new SystemOutStream object from standard out
jpiv2.SystemOutStream out = new jpiv.SystemOutStream(System.out);
// assigning the CmdFrame to the new SystemOutStream object
out.assignCmdFrame(cmdFrame);
// redirecting standard output to the new PrintStream object
System.setOut(out);
jpiv2.SystemOutStream is a PrintStream object. That means that a standard
output stream can be redirected to it by System.setOut(PrintStream ps).
To get the output to the screen, make this SystemOutStream familiar with your
jpiv2.CmdFrame by using the method assignCmdFrame(jpiv2.CmdFrame cmdFrame).
The write methods in jpiv2.SystemOutStream (overridden in super-class)
write the standard output to the assigned CmdFrame by using
jpiv2.CmdFrame.append(String str).
| Field Summary |
|---|
| Fields inherited from class java.io.FilterOutputStream |
|---|
out |
| Constructor Summary | |
|---|---|
SystemOutStream(java.io.PrintStream ps)
Creates a new instance of SystemOutStream. |
|
| Method Summary | |
|---|---|
void |
assignCmdFrame(CmdFrame cmdFrame)
Defines the destination for the system output. |
void |
write(byte[] buf,
int off,
int len)
Overrides write(byte buf[], int off, int len) in PrintStream. |
void |
write(int b)
Overrides write(int b) in PrintStream. |
| Methods inherited from class java.io.PrintStream |
|---|
append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError |
| Methods inherited from class java.io.FilterOutputStream |
|---|
write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SystemOutStream(java.io.PrintStream ps)
SystemOutStream.
ps - A PrintStream object like System.out.| Method Detail |
|---|
public void assignCmdFrame(CmdFrame cmdFrame)
cmdFrame - The jpiv2.CmdFrame that serves as a destination
for system output.public void write(int b)
write(int b) in PrintStream.
The data is written to the assigned jpiv2.CmdFrame.
write in class java.io.PrintStreamb - A value to be written.
public void write(byte[] buf,
int off,
int len)
write(byte buf[], int off, int len) in PrintStream. The data
is written to the assigned jpiv2.CmdFrame.
write in class java.io.PrintStreambuf - A byte buffer to be written.off - Index of first written buffer element.len - Number of written buffer elements.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||