8251942: PrintStream specification is not clear which flush method is automatically invoked

Reviewed-by: dfuchs, alanb
This commit is contained in:
Brian Burkhalter 2021-03-23 16:06:21 +00:00
parent 8fa34e4043
commit d7268fa3a6

View File

@ -39,9 +39,9 @@ import java.nio.charset.UnsupportedCharsetException;
* {@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 is
* automatically invoked after a byte array is written, one of the
* {@code println} methods is invoked, or a newline character or byte
* 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.
*
* <p> All characters printed by a {@code PrintStream} are converted into
@ -50,8 +50,8 @@ import java.nio.charset.UnsupportedCharsetException;
* The {@link PrintWriter} class should be used in situations that require
* writing characters rather than bytes.
*
* <p> This class always replaces malformed and unmappable character sequences with
* the charset's default replacement string.
* <p> 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.
*
@ -516,7 +516,7 @@ public class PrintStream extends FilterOutputStream
/**
* Writes the specified byte to this stream. If the byte is a newline and
* automatic flushing is enabled then the {@code flush} method will be
* invoked.
* invoked on the underlying output stream.
*
* <p> Note that the byte is written as given; to write a character that
* will be translated according to the platform's default character
@ -548,7 +548,8 @@ public class PrintStream extends FilterOutputStream
/**
* Writes {@code len} bytes from the specified byte array starting at
* offset {@code off} to this stream. If automatic flushing is
* enabled then the {@code flush} method will be invoked.
* enabled then the {@code flush} method will be invoked on the underlying
* output stream.
*
* <p> Note that the bytes will be written as given; to write characters
* that will be translated according to the platform's default character
@ -580,7 +581,7 @@ public class PrintStream extends FilterOutputStream
/**
* Writes all bytes from the specified byte array to this stream. If
* automatic flushing is enabled then the {@code flush} method will be
* invoked.
* invoked on the underlying output stream.
*
* <p> Note that the bytes will be written as given; to write characters
* that will be translated according to the platform's default character