Writer (Java SE 25 & JDK 25)
- All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable
- Direct Known Subclasses:
BufferedWriter, CharArrayWriter, FilterWriter, OutputStreamWriter, PipedWriter, PrintWriter, StringWriter
-
Field Summary
Fields
The object used to synchronize operations on this stream.
-
Constructor Summary
Constructors
protectedWriter()Creates a new character-stream writer whose critical sections will synchronize on the writer itself.
protectedCreates a new character-stream writer whose critical sections will synchronize on the given object.
-
Method Summary
append(char c) Appends the specified character to this writer.
Appends the specified character sequence to this writer.
Appends a subsequence of the specified character sequence to this writer.
abstract voidclose()Closes the stream, flushing it first.
abstract voidflush()Returns a new
Writerwhich discards all characters.voidwrite(char[] cbuf) Writes an array of characters.
abstract voidwrite(char[] cbuf, int off, int len) Writes a portion of an array of characters.
voidwrite(int c) Writes a single character.
voidvoidwrite(String str, int off, int len) Writes a portion of a string.
-
Field Details
-
lock
-
-
Constructor Details
-
Writer
-
Writer
-
-
Method Details
-
nullWriter
-
write
-
write
-
write
-
write
-
write
-
append
-
append
-
append
-
flush
-
close
-