Writer

public abstract class Writer extends Object
implements Appendable Closeable Flushable
Known Direct Subclasses
Known Indirect Subclasses

Abstract class for writing to character streams. The only methods that a subclass must implement are write(char[], int, int), flush(), and close(). Most subclasses, however, will override some of the methods defined here in order to provide higher efficiency, additional functionality, or both.

Field Summary

protected Object lock The object used to synchronize operations on this stream.

Protected Constructor Summary

Writer()
Creates a new character-stream writer whose critical sections will synchronize on the writer itself.
Writer(Object lock)
Creates a new character-stream writer whose critical sections will synchronize on the given object.

Public Method Summary

Writer
append(char c)
Appends the specified character to this writer.
Writer
append(CharSequence csq, int start, int end)
Appends a subsequence of the specified character sequence to this writer.
Writer
append(CharSequence csq)
Appends the specified character sequence to this writer.
abstract void
close()
Closes the stream, flushing it first.
abstract void
flush()
Flushes the stream.
void
write(String str)
Writes a string.
void
write(int c)
Writes a single character.
void
write(String str, int off, int len)
Writes a portion of a string.
abstract void
write(char[] cbuf, int off, int len)
Writes a portion of an array of characters.
void
write(char[] cbuf)
Writes an array of characters.

Inherited Method Summary