CharArrayWriter (Java SE 25 & JDK 25)
- All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable
-
Field Summary
Fields
protected char[]The buffer where data is stored.
protected intThe number of chars in the buffer.
-
Constructor Summary
Constructors
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.
Appends the specified character sequence to this writer.
Appends a subsequence of the specified character sequence to this writer.
voidclose()voidflush()voidreset()Resets the buffer so that you can use it again without throwing away the already allocated buffer.
intsize()Returns the current size of the buffer.
char[]Returns a copy of the input data.
toString()Converts input data to a string.
voidwrite(char[] c, int off, int len) Writes characters to the buffer.
voidwrite(int c) Writes a character to the buffer.
voidwrite(String str, int off, int len) Write a portion of a string to the buffer.
voidWrites the contents of the buffer to another character stream.
-
Field Details
-
buf
-
count
-
-
Constructor Details
-
CharArrayWriter
-
CharArrayWriter
-
-
Method Details
-
write
-
write
-
write
-
writeTo
-
append
-
append
-
append
-
reset
-
toCharArray
-
size
-
toString
-
flush
-
close
-