List of all members.
PrintStreamadds functionality to another output stream, namely the ability to print representations of various data values conveniently.
Two other features are provided as well. Unlike other output streams, a
PrintStream never throws an
IOException; instead, exceptional situations merely set an internal flag that can be tested via the
checkError method. Optionally, a
PrintStream can be created so as to flush automatically; this means that the
flush method is automatically invoked after a byte array is written, one of the
println methods is invoked, or a newline character or byte (
') is written.
All characters printed by a
PrintStream are converted into bytes using the platform's default character encoding. The
PrintWriter class should be used in situations that require writing characters rather than bytes.
Public Member Functions
|PrintStream (const Ref< OutputStream > &out=0, jboolean autoFlush=false, const String &enc=nilCString)|
|Create a new print stream. |
|virtual void||write (jint b)|
|Writes the specified byte to this file output stream. |
|virtual void||write (const Array< jbyte > &b, jint off=0, jint len=-1)|
|virtual void||flush ()|
|Flushes this output stream and forces any buffered output bytes to be written out to the stream. |
|virtual void||close ()|
|Closes this file output stream and releases any system resources associated with this stream. |
|virtual jboolean||checkError ()|
|Flush the stream and check its error state. |
|virtual void||print (const String &s)|
|Print a string. |
|virtual void||println (const String &x=nilString)|
|Print a String and then terminate the line. |
|java::io::PrintStream::PrintStream||(||const Ref< OutputStream > &|| out =
|jboolean|| autoFlush =
|const String &|| enc = |
Create a new print stream.
|out||The output stream to which values and objects will be printed|
|autoFlush||A boolean; if true, the output buffer will be flushed whenever a byte array is written, one of the |
|encoding||The name of a supported character encoding|
|UnsupportedEncodingException||If the named encoding is not supported|
|virtual void java::io::PrintStream::write||(||jint||b||)||
|virtual void java::io::PrintStream::write||(||const Array< jbyte > &||b,|
|jint|| off =
|jint|| len = |
|virtual void java::io::PrintStream::flush||(||)||
|virtual void java::io::PrintStream::close||(||)||
|virtual jboolean java::io::PrintStream::checkError||(||)||
Flush the stream and check its error state.
The internal error state is set to
true when the underlying output stream throws an
IOException other than
InterruptedIOException, and when the
setError method is invoked. If an operation on the underlying output stream throws an
InterruptedIOException, then the
PrintStream converts the exception back into an interrupt by doing:
Thread.currentThread().interrupt();or the equivalent.
InterruptedIOException, or the
setErrormethod has been invoked
|virtual void java::io::PrintStream::print||(||const String &||s||)||
Print a string.
If the argument is
null then the string
"null" is printed. Otherwise, the string's characters are converted into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the
|virtual void java::io::PrintStream::println||(||const String &|| x =