checkError

public boolean 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.

Overrides:

checkError in class java.io.PrintStream

Returns:

True if and only if this stream has encountered an IOException other than InterruptedIOException, or the setError method has been invoked

setError

protected void setError()

Set the error state of the stream to true.

Overrides:

setError in class java.io.PrintStream

Since:

JDK1.1

write

public void write(int b)

Write the specified byte to this stream. If the byte is a newline and automatic flushing is enabled then the flush method will be invoked.

Note that the byte is written as given; to write a character that will be translated according to the platform's default character encoding, use the print(char) or println(char) methods.

print

public void print(boolean f)

Print a boolean value. The string produced by 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 write(int) method.

Overrides:

print in class java.io.PrintStream

Parameters:

f - The boolean to be printed

print

public void print(char ch)

Print a character. The character is translated into one or more bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.

Overrides:

print in class java.io.PrintStream

Parameters:

ch - The char to be printed

print

public void print(int i)

Print an integer. The string produced by String.valueOf(int) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.

Overrides:

print in class java.io.PrintStream

Parameters:

i - The int to be printed

See Also:

Integer.toString(int)

print

public void print(long l)

Print a long integer. The string produced by String.valueOf(long) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.

Overrides:

print in class java.io.PrintStream

Parameters:

l - The long to be printed

See Also:

Long.toString(long)

print

public void print(float fl)

Print a floating-point number. The string produced by String.valueOf(float) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.

Overrides:

print in class java.io.PrintStream

Parameters:

fl - The float to be printed

See Also:

Float.toString(float)

print

public void print(double dfl)

Print a double-precision floating-point number. The string produced by String.valueOf(double) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.

Overrides:

print in class java.io.PrintStream

Parameters:

dfl - The double to be printed

See Also:

Double.toString(double)

print

public void print(char[] ach)

Print an array of characters. The characters are converted into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.

Overrides:

print in class java.io.PrintStream

Parameters:

ach - The array of chars to be printed

Throws:

java.lang.NullPointerException - If s is null

print

public void print(java.lang.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 write(int) method.

Overrides:

print in class java.io.PrintStream

Parameters:

s - The String to be printed

print

public void print(java.lang.Object o)

Print an object. The string produced by the String.valueOf(Object) method is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.

Overrides:

print in class java.io.PrintStream

Parameters:

o - The Object to be printed

See Also:

Object.toString()

println

public void println()

Terminate 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').

Overrides:

println in class java.io.PrintStream

println

public void println(boolean f)

Print a boolean and then terminate the line. This method behaves as though it invokes print(boolean) and then println().

Overrides:

println in class java.io.PrintStream

Parameters:

f - The boolean to be printed

println

public void println(char ch)

Print a character and then terminate the line. This method behaves as though it invokes print(char) and then println().

Overrides:

println in class java.io.PrintStream

Parameters:

ch - The char to be printed.

println

public void println(int i)

Print an integer and then terminate the line. This method behaves as though it invokes print(int) and then println().

Overrides:

println in class java.io.PrintStream

Parameters:

i - The int to be printed.

println

public void println(long l)

Print a long and then terminate the line. This method behaves as though it invokes print(long) and then println().

Overrides:

println in class java.io.PrintStream

Parameters:

l - a The long to be printed.

println

public void println(float fl)

Print a float and then terminate the line. This method behaves as though it invokes print(float) and then println().

Overrides:

println in class java.io.PrintStream

Parameters:

fl - The float to be printed.

println

public void println(double dfl)

Print a double and then terminate the line. This method behaves as though it invokes print(double) and then println().

Overrides:

println in class java.io.PrintStream

Parameters:

dfl - The double to be printed.

println

public void println(char[] ach)

Print an array of characters and then terminate the line. This method behaves as though it invokes print(char[]) and then println().

Overrides:

println in class java.io.PrintStream

Parameters:

ach - an array of chars to print.

println

public void println(java.lang.String s)

Print a String and then terminate the line. This method behaves as though it invokes print(String) and then println().

Overrides:

println in class java.io.PrintStream

Parameters:

s - The String to be printed.

println

public void println(java.lang.Object o)

Print an Object and then terminate the line. This method behaves as though it invokes print(Object) and then println().