Class AppendableWriter<T extends Appendable>

    • Constructor Detail

      • AppendableWriter

        public AppendableWriter​(T appendable)
        Constructs a new instance with the specified appendable.
        Parameters:
        appendable - the appendable to write to
    • Method Detail

      • append

        public Writer append​(char c)
                      throws IOException
        Appends the specified character to the underlying appendable.
        Specified by:
        append in interface Appendable
        Overrides:
        append in class Writer
        Parameters:
        c - the character to append
        Returns:
        this writer
        Throws:
        IOException - upon error
      • append

        public Writer append​(CharSequence csq,
                             int start,
                             int end)
                      throws IOException
        Appends a subsequence of the specified character sequence to the underlying appendable.
        Specified by:
        append in interface Appendable
        Overrides:
        append in class Writer
        Parameters:
        csq - the character sequence from which a subsequence will be appended
        start - the index of the first character in the subsequence
        end - the index of the character following the last character in the subsequence
        Returns:
        this writer
        Throws:
        IOException - upon error
      • getAppendable

        public T getAppendable()
        Return the target appendable.
        Returns:
        the target appendable
      • write

        public void write​(char[] cbuf,
                          int off,
                          int len)
                   throws IOException
        Writes a portion of an array of characters to the underlying appendable.
        Specified by:
        write in class Writer
        Parameters:
        cbuf - an array with the characters to write
        off - offset from which to start writing characters
        len - number of characters to write
        Throws:
        IOException - upon error
      • write

        public void write​(int c)
                   throws IOException
        Writes a character to the underlying appendable.
        Overrides:
        write in class Writer
        Parameters:
        c - the character to write
        Throws:
        IOException - upon error
      • write

        public void write​(String str,
                          int off,
                          int len)
                   throws IOException
        Writes a portion of a String to the underlying appendable.
        Overrides:
        write in class Writer
        Parameters:
        str - a string
        off - offset from which to start writing characters
        len - number of characters to write
        Throws:
        IOException - upon error