All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

  • Field Summary

    Fields

    protected char[]

    The buffer where data is stored.

    protected int

    The 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.

    void

    close()

    void

    flush()

    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(String str, int off, int len)

    Write a portion of a string to the buffer.

    void

    Writes 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