BufferedWriter
, CharArrayWriter
, FilterWriter
, OutputStreamWriter
, FileWriter
, PipedWriter
, PrintWriter
, StringWriter
, Reader
Modifier and Type | Field and Description |
---|---|
protected Object | lock
The object used to synchronize operations on this stream. |
private static final int | WRITE_BUFFER_SIZE
Size of writeBuffer, must be >= 1 |
private char[] | writeBuffer
Temporary buffer used to hold writes of strings and single characters |
Access | Constructor and Description |
---|---|
protected | Writer()
Creates a new character-stream writer whose critical sections will synchronize on the writer itself. |
pack-priv | |
protected |
Modifier and Type | Method and Description |
---|---|
public Writer | Returns: This writerThe character sequence to append. If csq)csq is
null , then the four characters "null" are
appended to this writer.Implements java. Appends the specified character sequence to this writer. |
public Writer | Returns: This writerThe character sequence from which a subsequence will be
appended. If csq, int csq is null , then characters
will be appended as if csq contained the four
characters "null" .The index of the first character in the subsequence start, int The index of the character following the last character in the
subsequence end)Implements java. Appends a subsequence of the specified character sequence to this writer. |
public Writer | Returns: This writerThe 16-bit character to append c)Implements java. Appends the specified character to this writer. |
public abstract void | |
public abstract void | |
private void | |
private void | |
public static Writer | Returns: aWriter which discards all charactersReturns a new |
public void | |
public void | |
public abstract void | write(char[]
Array of characters cbuf, int Offset from which to start writing characters off, int Number of characters to write len)Writes a portion of an array of characters. |
public void | |
public void |
lock | back to summary |
---|---|
protected Object lock The object used to synchronize operations on this stream. For
efficiency, a character-stream object may use an object other than
itself to protect critical sections. A subclass should therefore use
the object in this field rather than |
WRITE_BUFFER_SIZE | back to summary |
---|---|
private static final int WRITE_BUFFER_SIZE Size of writeBuffer, must be >= 1 |
writeBuffer | back to summary |
---|---|
private char[] writeBuffer Temporary buffer used to hold writes of strings and single characters |
Writer | back to summary |
---|---|
protected Writer() Creates a new character-stream writer whose critical sections will synchronize on the writer itself. |
Writer | back to summary |
---|---|
pack-priv Writer(Writer writer) For use by BufferedWriter to create a character-stream writer that uses an internal lock when BufferedWriter is not extended and the given writer is trusted, otherwise critical sections will synchronize on the given writer. |
Writer | back to summary |
---|---|
protected Writer(Object lock) Creates a new character-stream writer whose critical sections will synchronize on the given object.
|
append | back to summary |
---|---|
public Writer append(CharSequence csq) throws IOException Implements java. Appends the specified character sequence to this writer. An invocation of this method of the form out.write(csq.toString()) Depending on the specification of
|
append | back to summary |
---|---|
public Writer append(CharSequence csq, int start, int end) throws IOException Implements java. Appends a subsequence of the specified character sequence to this writer.
An invocation of this method of the form
out.write(csq.subSequence(start, end).toString())
|
append | back to summary |
---|---|
public Writer append(char c) throws IOException Implements java. Appends the specified character to this writer. An invocation of this method of the form out.write(c)
|
close | back to summary |
---|---|
public abstract void close() throws IOException Redeclares java. Closes the stream, flushing it first. Once the stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. Closing a previously closed stream has no effect.
|
flush | back to summary |
---|---|
public abstract void flush() throws IOException Redeclares java. Flushes the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams. If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
|
implWrite | back to summary |
---|---|
private void implWrite(int c) throws IOException |
implWrite | back to summary |
---|---|
private void implWrite(String str, int off, int len) throws IOException |
nullWriter | back to summary |
---|---|
public static Writer nullWriter() Returns a new While the stream is open, the The
|
write | back to summary |
---|---|
public void write(int c) throws IOException Writes a single character. The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored. Subclasses that intend to support efficient single-character output should override this method.
|
write | back to summary |
---|---|
public void write(char[] cbuf) throws IOException Writes an array of characters.
|
write | back to summary |
---|---|
public abstract void write(char[] cbuf, int off, int len) throws IOException Writes a portion of an array of characters.
|
write | back to summary |
---|---|
public void write(String str) throws IOException Writes a string.
|
write | back to summary |
---|---|
public void write(String str, int off, int len) throws IOException Writes a portion of a string. Implementation Specification The implementation in this class throws an
|