| java.lang.Object java.io.Writer java.io.BufferedWriter
BufferedWriter | public class BufferedWriter extends Writer (Code) | | BufferedWriter is for writing buffered character output. Characters written
to this Writer are buffered internally before being committed to the target
Writer.
See Also: BufferedReader |
Constructor Summary | |
public | BufferedWriter(Writer out) Constructs a new BufferedReader with out as the Writer on
which to buffer write operations. | public | BufferedWriter(Writer out, int size) Constructs a new BufferedReader with out as the Writer on
which buffer write operations. |
Method Summary | |
public void | close() Close this BufferedWriter. | public void | flush() Flush this BufferedWriter. | public void | newLine() Write a newline to thie Writer. | public void | write(char[] cbuf, int offset, int count) Writes out count characters starting at
offset in buf to this BufferedWriter. | public void | write(int oneChar) Writes the character oneChar BufferedWriter. | public void | write(String str, int offset, int count) Writes out count characters starting at
offset in str to this BufferedWriter. |
BufferedWriter | public BufferedWriter(Writer out)(Code) | | Constructs a new BufferedReader with out as the Writer on
which to buffer write operations. The buffer size is set to the default,
which is 8K.
Parameters: out - The Writer to buffer character writing on |
BufferedWriter | public BufferedWriter(Writer out, int size)(Code) | | Constructs a new BufferedReader with out as the Writer on
which buffer write operations. The buffer size is set to
size .
Parameters: out - The Writer to buffer character writing on. Parameters: size - The size of the buffer to use. |
close | public void close() throws IOException(Code) | | Close this BufferedWriter. The contents of the buffer are flushed, the
target writer is closed, and the buffer is released. Only the first
invocation of close has any effect.
throws: IOException - If an error occurs attempting to close this Writer. |
flush | public void flush() throws IOException(Code) | | Flush this BufferedWriter. The contents of the buffer are committed to
the target writer and it is then flushed.
throws: IOException - If an error occurs attempting to flush this Writer. |
newLine | public void newLine() throws IOException(Code) | | Write a newline to thie Writer. A newline is determined by the System
property "line.separator". The target writer may or may not be flushed
when a newline is written.
throws: IOException - If an error occurs attempting to write to this Writer. |
write | public void write(char[] cbuf, int offset, int count) throws IOException(Code) | | Writes out count characters starting at
offset in buf to this BufferedWriter. If
count is greater than this Writers buffer then flush the
contents and also write the characters directly to the target Writer.
Parameters: cbuf - the non-null array containing characters to write. Parameters: offset - offset in buf to retrieve characters Parameters: count - maximum number of characters to write throws: IOException - If this Writer has already been closed or some otherIOException occurs. throws: IndexOutOfBoundsException - If offset or count are outside of bounds. |
write | public void write(int oneChar) throws IOException(Code) | | Writes the character oneChar BufferedWriter. If the buffer
is filled by writing this character, flush this Writer. Only the lower 2
bytes are written.
Parameters: oneChar - The Character to write out. throws: IOException - If this Writer has already been closed or some otherIOException occurs. |
write | public void write(String str, int offset, int count) throws IOException(Code) | | Writes out count characters starting at
offset in str to this BufferedWriter. If
count is greater than this Writers buffer then flush the
contents and also write the characters directly to the target Writer.
Parameters: str - the non-null String containing characters to write Parameters: offset - offset in str to retrieve characters Parameters: count - maximum number of characters to write throws: IOException - If this Writer has already been closed or some otherIOException occurs. throws: ArrayIndexOutOfBoundsException - If offset or count are outside of bounds. |
|
|