PrintStream (Java SE 25 & JDK 25)
- All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable
- Direct Known Subclasses:
LogStream
-
Field Summary
-
Constructor Summary
Constructors
Creates a new print stream, without automatic line flushing, with the specified file.
Creates a new print stream, without automatic line flushing, with the specified file and charset.
Creates a new print stream, without automatic line flushing, with the specified file and charset.
Creates a new print stream, without automatic line flushing, with the specified OutputStream.
Creates a new print stream, with the specified OutputStream and line flushing.
Creates a new print stream, with the specified OutputStream, line flushing, and character encoding.
Creates a new print stream, with the specified OutputStream, line flushing and charset.
Creates a new print stream, without automatic line flushing, with the specified file name.
Creates a new print stream, without automatic line flushing, with the specified file name and charset.
Creates a new print stream, without automatic line flushing, with the specified file name and charset.
-
Method Summary
append(char c) Appends the specified character to this output stream.
Appends the specified character sequence to this output stream.
Appends a subsequence of the specified character sequence to this output stream.
charset()Returns the charset used in this
PrintStreaminstance.booleanFlushes the stream if it's not closed and checks its error state.
protected voidClears the error state of this stream.
voidclose()voidflush()Writes a formatted string to this output stream using the specified format string and arguments.
Writes a formatted string to this output stream using the specified format string and arguments.
voidprint(boolean b) voidprint(char c) voidprint(char[] s) Prints an array of characters.
voidprint(double d) Prints a double-precision floating-point number.
voidprint(float f) Prints a floating-point number.
voidprint(int i) voidprint(long l) voidvoidA convenience method to write a formatted string to this output stream using the specified format string and arguments.
A convenience method to write a formatted string to this output stream using the specified format string and arguments.
voidprintln()Terminates the current line by writing the line separator string.
voidprintln(boolean x) Prints a boolean and then terminates the line.
voidprintln(char x) Prints a character and then terminates the line.
voidprintln(char[] x) Prints an array of characters and then terminates the line.
voidprintln(double x) Prints a double and then terminates the line.
voidprintln(float x) Prints a float and then terminates the line.
voidprintln(int x) Prints an integer and then terminates the line.
voidprintln(long x) Prints a long and then terminates the line.
voidPrints an Object and then terminates the line.
voidPrints a String and then terminates the line.
protected voidsetError()Sets the error state of the stream to
true.voidwrite(byte[] buf) Writes all bytes from the specified byte array to this stream.
voidwrite(byte[] buf, int off, int len) Writes
lenbytes from the specified byte array starting at offsetoffto this stream.voidwrite(int b) Writes the specified byte to this stream.
voidwriteBytes(byte[] buf) Writes all bytes from the specified byte array to this stream.
-
Constructor Details
-
PrintStream
-
PrintStream
-
PrintStream
-
PrintStream
-
PrintStream
-
PrintStream
-
PrintStream
-
PrintStream
-
PrintStream
-
PrintStream
-
-
Method Details
-
flush
-
close
-
checkError
-
setError
-
clearError
-
write
-
write
-
write
-
writeBytes
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
println
-
println
-
println
-
println
-
println
-
println
-
println
-
println
-
println
-
println
-
printf
-
printf
-
format
-
format
-
append
-
append
-
append
-
charset
-