? AppendableWriter<T extends Appendable>

java.lang.Object
java.io.Writer
org.apache.commons.io.output.AppendableWriter<T>
????:
T - The type of the Appendable wrapped by this AppendableWriter.
????????:
Closeable, Flushable, Appendable, AutoCloseable

public class AppendableWriter<T extends Appendable> extends Writer
Writer implementation that writes the data to an Appendable Object.

For example, can be used with a StringBuilder or StringBuffer.

???????:
2.7
????:
  • ???????

    • AppendableWriter

      public AppendableWriter(T appendable)
      Constructs a new instance with the specified appendable.
      ??:
      appendable - the appendable to write to
  • ??????

    • append

      public Writer append(char c) throws IOException
      Appends the specified character to the underlying appendable.
      ???:
      append ???? Appendable
      ??:
      append ??? Writer
      ??:
      c - the character to append
      ??:
      this writer
      ??:
      IOException - upon error
    • append

      public Writer append(CharSequence csq) throws IOException
      Appends the specified character sequence to the underlying appendable.
      ???:
      append ???? Appendable
      ??:
      append ??? Writer
      ??:
      csq - the character sequence to append
      ??:
      this writer
      ??:
      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.
      ???:
      append ???? Appendable
      ??:
      append ??? Writer
      ??:
      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
      ??:
      this writer
      ??:
      IOException - upon error
    • close

      public void close() throws IOException
      Closes the stream. This implementation does nothing.
      ???:
      close ???? AutoCloseable
      ???:
      close ???? Closeable
      ???:
      close ??? Writer
      ??:
      IOException - upon error
    • flush

      public void flush() throws IOException
      Flushes the stream. This implementation does nothing.
      ???:
      flush ???? Flushable
      ???:
      flush ??? Writer
      ??:
      IOException - upon error
    • getAppendable

      public T getAppendable()
      Return the target appendable.
      ??:
      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.
      ???:
      write ??? Writer
      ??:
      cbuf - an array with the characters to write
      off - offset from which to start writing characters
      len - number of characters to write
      ??:
      IOException - upon error
    • write

      public void write(int c) throws IOException
      Writes a character to the underlying appendable.
      ??:
      write ??? Writer
      ??:
      c - the character to write
      ??:
      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.
      ??:
      write ??? Writer
      ??:
      str - a string
      off - offset from which to start writing characters
      len - number of characters to write
      ??:
      IOException - upon error