PrintWriter

extern class java.io.PrintWriterextends WriterAvailable in javaPrints formatted representations of objects to a text-output stream. This class implements all of the <tt>print</tt> methods found in {@link PrintStream}. It does not contain methods for writing raw bytes, for which a program should use unencoded byte streams.
<p> Unlike the {@link PrintStream} class, if automatic flushing is enabled it will be done only when one of the <tt>println</tt>, <tt>printf</tt>, or <tt>format</tt> methods is invoked, rather than whenever a newline character happens to be output. These methods use the platform's own notion of line separator rather than the newline character.
<p> Methods in this class never throw I/O exceptions, although some of its constructors may. The client may inquire as to whether any errors have occurred by invoking {@link #checkError checkError()}.
author      Frank Yellin author Mark Reinhold @since JDK1.1
function new( param1 : Writer ) : VoidCreates a new PrintWriter, without automatic line flushing.
@param out A character-output stream
function checkError() : BoolFlushes the stream if it's not closed and checks its error state.
@return
true
if the print stream has encountered an error, either on the underlying output stream or during a format conversion.
function format( param1 : String, param2 : NativeArray<Dynamic> ) : PrintWriterWrites a formatted string to this writer using the specified format string and arguments. If automatic flushing is enabled, calls to this method will flush the output buffer.
<p> The locale always used is the one returned by {@link java.util.Locale#getDefault() Locale.getDefault()}, regardless of any previous invocations of other formatting methods on this object.
@param format A format string as described in <a href="../util/Formatter.html#syntax">Format string syntax</a>.
@param args Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by <cite>The Java&trade; Virtual Machine Specification</cite>. The behaviour on a <tt>null</tt> argument depends on the <a href="../util/Formatter.html#syntax">conversion</a>.
@throws IllegalFormatException If a format string contains an illegal syntax, a format specifier that is incompatible with the given arguments, insufficient arguments given the format string, or other illegal conditions. For specification of all possible formatting errors, see the <a href="../util/Formatter.html#detail">Details</a> section of the Formatter class specification.
@throws NullPointerException If the <tt>format</tt> is <tt>null</tt>
@return This writer
@since 1.5
function print( param1 : Bool ) : VoidPrints a boolean value. The string produced by
{@link java.lang.String#valueOf(boolean)}
is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the
{@link #write(int)}
method.
@param b The
boolean
to be printed
function printf( param1 : String, param2 : NativeArray<Dynamic> ) : PrintWriterA convenience method to write a formatted string to this writer using the specified format string and arguments. If automatic flushing is enabled, calls to this method will flush the output buffer.
<p> An invocation of this method of the form <tt>out.printf(format, args)</tt> behaves in exactly the same way as the invocation
<pre> out.format(format, args) </pre>
@param format A format string as described in <a href="../util/Formatter.html#syntax">Format string syntax</a>.
@param args Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by <cite>The Java&trade; Virtual Machine Specification</cite>. The behaviour on a <tt>null</tt> argument depends on the <a href="../util/Formatter.html#syntax">conversion</a>.
@throws IllegalFormatException If a format string contains an illegal syntax, a format specifier that is incompatible with the given arguments, insufficient arguments given the format string, or other illegal conditions. For specification of all possible formatting errors, see the <a href="../util/Formatter.html#detail">Details</a> section of the formatter class specification.
@throws NullPointerException If the <tt>format</tt> is <tt>null</tt>
@return This writer
@since 1.5
function println() : VoidTerminates the current line by writing the line separator string. The line separator string is defined by the system property
line.separator
, and is not necessarily a single newline character (
'\n'
).
version #18557, modified 2013-05-08 10:54:23 by api
0 comment