|
FlexDoc/Javadoc 2.0 Demo Java Doc |
Note: Invoking close() on this class has no effect, and methods of this class can be called after the stream has closed without generating an IOException.
Field Summary |
||
protected char[] |
The buffer where data is stored.
|
|
protected int |
The number of chars in the buffer.
|
Fields inherited from class java.io.Writer |
Constructor Summary |
||
Creates a new CharArrayWriter.
|
||
CharArrayWriter(int initialSize)
Creates a new CharArrayWriter with the specified initial size.
|
Method Summary |
||
append(char c)
Appends the specified character to this writer.
|
||
append(CharSequence csq)
Appends the specified character sequence to this writer.
|
||
append(CharSequence csq, int start, int end)
Appends a subsequence of the specified character sequence to this writer.
|
||
void |
close()
Close the stream.
|
|
void |
flush()
Flush the stream.
|
|
void |
reset()
Resets the buffer so that you can use it again without
throwing away the already allocated buffer.
|
|
int |
size()
Returns the current size of the buffer.
|
|
char[] |
Returns a copy of the input data.
|
|
toString()
Converts input data to a string.
|
||
void |
write(char[] c, int off, int len)
Writes characters to the buffer.
|
|
void |
write(int c)
Writes a character to the buffer.
|
|
void |
Write a portion of a string to the buffer.
|
|
void |
Writes the contents of the buffer to another character stream.
|
Methods inherited from class java.io.Writer |
Methods inherited from class java.lang.Object |
public CharArrayWriter |
() |
public CharArrayWriter |
(int initialSize) |
public void write |
(int c) |
public void write |
(char[] c, int off, int len) |
public void write |
public void writeTo |
(Writer out) |
throws |
public CharArrayWriter append |
(CharSequence csq) |
An invocation of this method of the form out.append(csq) behaves in exactly the same way as the invocation
out.write(csq.toString())
Depending on the specification of toString for the character sequence csq, the entire sequence may not be appended. For instance, invoking the toString method of a character buffer will return a subsequence whose content depends upon the buffer's position and limit.
public CharArrayWriter append |
An invocation of this method of the form out.append(csq, start, end) when csq is not null, behaves in exactly the same way as the invocation
out.write(csq.subSequence(start, end).toString())
public CharArrayWriter append |
(char c) |
An invocation of this method of the form out.append(c) behaves in exactly the same way as the invocation
out.write(c)
public void reset |
() |
public char[] toCharArray |
() |
public int size |
() |
public String toString |
() |
public void flush |
() |
The flush method of CharArrayWriter does nothing.
public void close |
() |
|
FlexDoc/Javadoc 2.0 Demo Java Doc |