Writer is the abstract class for writing to character streams.
The following table lists all Writer and Reader classes.
- Buffered input character stream
- Buffered output character stream
- Input stream that reads from a character array
- Output stream that writes to a character array
- Input stream that reads from a file
- Output stream that writes to a file
- Filtered reader
- Filtered writer
- Input stream that translates bytes to characters
- Input stream that counts lines
- Output stream that translates characters to bytes
- Input pipe
- Output pipe
- Output stream that contains print( ) and println( )
- Input stream that allows characters to be returned to the input stream
- Abstract class that describes character stream input
- Input stream that reads from a string
- Output stream that writes to a string
- Abstract class that describes character stream output
Methods defined by Writer:
Writer append(char c)
- Appends the specified character to this writer.
Writer append(CharSequence csq)
- Appends the specified character sequence to this writer.
Writer append(CharSequence csq, int start, int end)
- Appends a subsequence of the specified character sequence to this writer.
abstract void close()
- Closes the stream, flushing it first.
abstract void flush()
- Flushes the stream.
void write(char cbuf)
- Writes an array of characters.
abstract void write(char cbuf, int off, int len)
- Writes a portion of an array of characters.
void write(int c)
- Writes a single character.
void write(String str)
- Writes a string.
void write(String str, int off, int len)
- Writes a portion of a string.
Revised from Open JDK source code