AppendableOutputStream (Commons IO 2.5)
Date: 2016-12-01

org.apache.commons.io.output

## Class AppendableOutputStream<T extends java.lang.Appendable>

- java.lang.Object
- - java.io.OutputStream
  - - org.apache.commons.io.output.AppendableOutputStream<T>

- All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

      public class AppendableOutputStream<T extends java.lang.Appendable>
      extends java.io.OutputStream

  OutputStream implementation that writes the data to an `Appendable` Object.

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

  Since:
    2.5
  Version:
    $Id: AppendableOutputStream.java 1687815 2015-06-26 17:18:56Z krosenvold $
  See Also:
    `Appendable`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private T` | `appendable`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AppendableOutputStream(T appendable)` Construct a new instance with the specified appendable.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `getAppendable()` Return the target appendable.
    `void` | `write(int b)` Write a character to the underlying appendable.

    - ### Methods inherited from class java.io.OutputStream

      `close, flush, write, write`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### appendable

          private final T extends java.lang.Appendable appendable

  - ### Constructor Detail

    - #### AppendableOutputStream

          public AppendableOutputStream(T appendable)

      Construct a new instance with the specified appendable.
      Parameters:
        `appendable` - the appendable to write to

  - ### Method Detail

    - #### write

          public void write(int b)
                     throws java.io.IOException

      Write a character to the underlying appendable.
      Specified by:
        `write` in class `java.io.OutputStream`
      Parameters:
        `b` - the character to write
      Throws:
        `java.io.IOException` - upon error

    - #### getAppendable

          public T getAppendable()

      Return the target appendable.
      Returns:
        the target appendable

Copyright (c) 2002-2016 Apache Software Foundation