The Java.io.CharArrayWriter class implements a character buffer that can be used as an Writer. The buffer automatically grows when data is written to the stream.
Following is the declaration for Java.io.CharArrayWriter class:
public class CharArrayWriter extends Writer
Following are the fields for Java.io.CharArrayWriter class:
protected char buf -- This is the buffer where data is stored.
protected int count -- This is the number of chars in the buffer.
protected Object lock -- This is the object used to synchronize operations on this stream.
|S.N.||Constructor & Description|
This creates a CharArrayReader from the specified array of chars.
This creates a new CharArrayWriter with the specified initial size.
|S.N.||Method & Description|
This method appends the specified character to this writer.
This method appends the specified character sequence to this writer.
This method appends a subsequence of the specified character sequence to this writer.
This method close the stream.
This method flush the stream.
This method resets the buffer so that you can use it again without throwing away the already allocated buffer.
This method returns the current size of the buffer.
This method returns a copy of the input data.
This method converts input data to a string.
This method writes characters to the buffer.
This method writes a character to the buffer.
This method write a portion of a string to the buffer.
This method writes the contents of the buffer to another character stream.
This class inherits methods from the following classes: