PrintStream
caution: only minimum functionality which is called by lucene is implemented
A {@code PrintStream} adds 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 {@code PrintStream} never throws an {@code IOException}; instead, exceptional situations merely set an internal flag that can be tested via the {@code checkError} method. Optionally, a {@code PrintStream} can be created so as to flush automatically; this means that the {@code flush} method of the underlying output stream is automatically invoked after a byte array is written, one of the {@code println} methods is invoked, or a newline character or byte ({@code '\n'}) is written.
All characters printed by a {@code PrintStream} are converted into bytes using the given encoding or charset, or the default charset if not specified. The {@link PrintWriter} class should be used in situations that require writing characters rather than bytes.
This class always replaces malformed and unmappable character sequences with the charset's default replacement string. The {@linkplain java.nio.charset.CharsetEncoder} class should be used when more control over the encoding process is required.
Author
Frank Yellin
Mark Reinhold
Since
1.0
See also
#defaultCharset()
Constructors
Functions
Terminates the current line by writing the line separator string. The line separator string is defined by the system property {@code line.separator}, and is not necessarily a single newline character ({@code '\n'}).
Prints a String and then terminates the line. This method behaves as though it invokes .print and then .println.
Writes b.length bytes to this output stream.
Writes the specified byte to this output stream.
Writes len bytes from the specified byte array starting at offset off to this output stream.