Class WriterPrintStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
com.tangosol.io.WriterPrintStream
- All Implemented Interfaces:
com.oracle.coherence.common.io.OutputStreaming,OutputStreaming,Closeable,Flushable,Appendable,AutoCloseable
Overrides PrintStream to delegate to a PrintWriter.
- Author:
- cp 2000.11.01
-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanFlush the stream and check its error state.voidclose()Close the stream.voidflush()Flush the stream.voidprint(boolean f) Print a boolean value.voidprint(char ch) Print a character.voidprint(char[] ach) Print an array of characters.voidprint(double dfl) Print a double-precision floating-point number.voidprint(float fl) Print a floating-point number.voidprint(int i) Print an integer.voidprint(long l) Print a long integer.voidPrint an object.voidPrint a string.voidprintln()Terminate the current line by writing the line separator string.voidprintln(boolean f) Print a boolean and then terminate the line.voidprintln(char ch) Print a character and then terminate the line.voidprintln(char[] ach) Print an array of characters and then terminate the line.voidprintln(double dfl) Print a double and then terminate the line.voidprintln(float fl) Print a float and then terminate the line.voidprintln(int i) Print an integer and then terminate the line.voidprintln(long l) Print a long and then terminate the line.voidPrint an Object and then terminate the line.voidPrint a String and then terminate the line.protected voidsetError()Set the error state of the stream totrue.voidwrite(byte[] ab, int of, int cb) Writelenbytes from the specified byte array starting at offsetoffto this stream.voidwrite(int b) Write the specified byte to this stream.Methods inherited from class java.io.PrintStream
append, append, append, charset, clearError, format, format, printf, printf, write, writeBytesMethods inherited from class java.io.OutputStream
nullOutputStreamMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oracle.coherence.common.io.OutputStreaming
write
-
Constructor Details
-
WriterPrintStream
-
-
Method Details
-
flush
public void flush()Flush the stream. This is done by writing any buffered output bytes to the underlying output stream and then flushing that stream.- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfacecom.oracle.coherence.common.io.OutputStreaming- Overrides:
flushin classPrintStream- See Also:
-
close
public void close()Close the stream. This is done by flushing the stream and then closing the underlying output stream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfacecom.oracle.coherence.common.io.OutputStreaming- Overrides:
closein classPrintStream- See Also:
-
checkError
public boolean checkError()Flush the stream and check its error state. The internal error state is set totruewhen the underlying output stream throws anIOExceptionother thanInterruptedIOException, and when thesetErrormethod is invoked. If an operation on the underlying output stream throws anInterruptedIOException, then thePrintStreamconverts the exception back into an interrupt by doing:Thread.currentThread().interrupt();or the equivalent.- Overrides:
checkErrorin classPrintStream- Returns:
- True if and only if this stream has encountered an
IOExceptionother thanInterruptedIOException, or thesetErrormethod has been invoked
-
setError
protected void setError()Set the error state of the stream totrue.- Overrides:
setErrorin classPrintStream- 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 theflushmethod 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)orprintln(char)methods.- Specified by:
writein interfacecom.oracle.coherence.common.io.OutputStreaming- Overrides:
writein classPrintStream- Parameters:
b- The byte to be written- See Also:
-
write
public void write(byte[] ab, int of, int cb) Writelenbytes from the specified byte array starting at offsetoffto this stream. If automatic flushing is enabled then theflushmethod will be invoked.Note that the bytes will be written as given; to write characters that will be translated according to the platform's default character encoding, use the
print(char)orprintln(char)methods.- Specified by:
writein interfacecom.oracle.coherence.common.io.OutputStreaming- Overrides:
writein classPrintStream- Parameters:
ab- A byte arrayof- Offset from which to start taking bytescb- Number of bytes to write
-
print
public void print(boolean f) Print a boolean value. The string produced byis translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(boolean)method.write(int)- Overrides:
printin classPrintStream- Parameters:
f- Thebooleanto 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 themethod.write(int)- Overrides:
printin classPrintStream- Parameters:
ch- Thecharto be printed
-
print
public void print(int i) Print an integer. The string produced byis translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(int)method.write(int)- Overrides:
printin classPrintStream- Parameters:
i- Theintto be printed- See Also:
-
print
public void print(long l) Print a long integer. The string produced byis translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(long)method.write(int)- Overrides:
printin classPrintStream- Parameters:
l- Thelongto be printed- See Also:
-
print
public void print(float fl) Print a floating-point number. The string produced byis translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(float)method.write(int)- Overrides:
printin classPrintStream- Parameters:
fl- Thefloatto be printed- See Also:
-
print
public void print(double dfl) Print a double-precision floating-point number. The string produced byis translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(double)method.write(int)- Overrides:
printin classPrintStream- Parameters:
dfl- Thedoubleto be printed- See Also:
-
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 themethod.write(int)- Overrides:
printin classPrintStream- Parameters:
ach- The array of chars to be printed- Throws:
NullPointerException- Ifsisnull
-
print
Print a string. If the argument isnullthen 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 themethod.write(int)- Overrides:
printin classPrintStream- Parameters:
s- TheStringto be printed
-
print
Print an object. The string produced by themethod is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(Object)method.write(int)- Overrides:
printin classPrintStream- Parameters:
o- TheObjectto be printed- See Also:
-
println
public void println()Terminate the current line by writing the line separator string. The line separator string is defined by the system propertyline.separator, and is not necessarily a single newline character ('\n').- Overrides:
printlnin classPrintStream
-
println
public void println(boolean f) Print a boolean and then terminate the line. This method behaves as though it invokesand thenprint(boolean).println()- Overrides:
printlnin classPrintStream- Parameters:
f- Thebooleanto be printed
-
println
public void println(char ch) Print a character and then terminate the line. This method behaves as though it invokesand thenprint(char).println()- Overrides:
printlnin classPrintStream- Parameters:
ch- Thecharto be printed.
-
println
public void println(int i) Print an integer and then terminate the line. This method behaves as though it invokesand thenprint(int).println()- Overrides:
printlnin classPrintStream- Parameters:
i- Theintto be printed.
-
println
public void println(long l) Print a long and then terminate the line. This method behaves as though it invokesand thenprint(long).println()- Overrides:
printlnin classPrintStream- Parameters:
l- a Thelongto be printed.
-
println
public void println(float fl) Print a float and then terminate the line. This method behaves as though it invokesand thenprint(float).println()- Overrides:
printlnin classPrintStream- Parameters:
fl- Thefloatto be printed.
-
println
public void println(double dfl) Print a double and then terminate the line. This method behaves as though it invokesand thenprint(double).println()- Overrides:
printlnin classPrintStream- Parameters:
dfl- Thedoubleto be printed.
-
println
public void println(char[] ach) Print an array of characters and then terminate the line. This method behaves as though it invokesand thenprint(char[]).println()- Overrides:
printlnin classPrintStream- Parameters:
ach- an array of chars to print.
-
println
Print a String and then terminate the line. This method behaves as though it invokesand thenprint(String).println()- Overrides:
printlnin classPrintStream- Parameters:
s- TheStringto be printed.
-
println
Print an Object and then terminate the line. This method behaves as though it invokesand thenprint(Object).println()- Overrides:
printlnin classPrintStream- Parameters:
o- TheObjectto be printed.
-