|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.Writer | +--org.erights.e.develop.exception.PrintStreamWriter
Untamed: This class shouldn't need to exist, but System.out
and
System.err
are both PrintStream
s, and PrintStream is
deprecated in favor of PrintWriter
.
XXX How should one obtain a Writer or PrintWriter to stdout and stderr? As long as we're at it, we also provide a static method for accessing System.in as a non-buffering BufferedReader (so that readline() is available).
Note that there is no reason to use this class as a type in a type declaration. No one should ever see any instances of it. Only its static methods are externally useful.
Note: As of some recent version of Java <= 1.3, PrintStream is no longer officially deprecated, probably because of System.out and System.err. However, E's TextWriters still need to wrap Writers, not PrintStreams, so we still need PrintStreamWriter.
Field Summary | |
private static PrintStream |
lastErrStream
|
private static PrintWriter |
lastErrWriter
|
private static BufferedReader |
lastInReader
|
private static InputStream |
lastInStream
|
private static PrintStream |
lastOutStream
|
private static PrintWriter |
lastOutWriter
|
private PrintStream |
myPS
|
Fields inherited from class java.io.Writer |
lock |
Constructor Summary | |
private |
PrintStreamWriter(PrintStream ps)
|
Method Summary | |
void |
close()
Enabled: |
void |
flush()
Enabled: |
static PrintWriter |
make(PrintStream ps)
Enabled: Wrap the PrintStream in an adaptor so it seems to be a PrintWriter. |
static PrintWriter |
stderr()
Enabled: System.err as a PrintWriter. |
static BufferedReader |
stdin()
Enabled: |
static PrintWriter |
stdout()
Enabled: System.out as a PrintWriter. |
void |
write(char[] cbuf,
int off,
int len)
Enabled: |
Methods inherited from class java.io.Writer |
write, write, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static PrintStream lastOutStream
private static PrintWriter lastOutWriter
private static PrintStream lastErrStream
private static PrintWriter lastErrWriter
private static InputStream lastInStream
private static BufferedReader lastInReader
private final PrintStream myPS
Constructor Detail |
private PrintStreamWriter(PrintStream ps)
Method Detail |
public static PrintWriter make(PrintStream ps)
public static PrintWriter stdout()
public static PrintWriter stderr()
public static BufferedReader stdin()
public void close()
close
in class Writer
public void flush()
flush
in class Writer
public void write(char[] cbuf, int off, int len)
write
in class Writer
cbuf
- Array of charactersoff
- Offset from which to start writing characterslen
- Number of characters to write
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |