OutputStreamFunneler (Apache Ant API)
Date: 2018-03-24

org.apache.tools.ant.util

## Class OutputStreamFunneler

- java.lang.Object
- - org.apache.tools.ant.util.OutputStreamFunneler

-     public class OutputStreamFunneler
      extends java.lang.Object

  Manages a set of `OutputStream`s to write to a single underlying stream, which is closed only when the last "funnel" has been closed.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `DEFAULT_TIMEOUT_MILLIS` Default timeout.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OutputStreamFunneler(java.io.OutputStream out)` Create a new `OutputStreamFunneler` for the specified `OutputStream`.
    `OutputStreamFunneler(java.io.OutputStream out, long timeoutMillis)` Create a new `OutputStreamFunneler` for the specified `OutputStream`, with the specified timeout value.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.io.OutputStream` | `getFunnelInstance()` Get a "funnel" `OutputStream` instance to write to this `OutputStreamFunneler`'s underlying `OutputStream`.
    `void` | `setTimeout(long timeoutMillis)` Set the timeout for this `OutputStreamFunneler`.

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

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

- - ### Field Detail

    - #### DEFAULT_TIMEOUT_MILLIS

          public static final long DEFAULT_TIMEOUT_MILLIS

      Default timeout.
      See Also:
        `setTimeout(long)`, Constant Field Values

  - ### Constructor Detail

    - #### OutputStreamFunneler

          public OutputStreamFunneler(java.io.OutputStream out)

      Create a new `OutputStreamFunneler` for the specified `OutputStream`.
      Parameters:
        `out` - `OutputStream`.

    - #### OutputStreamFunneler

          public OutputStreamFunneler(java.io.OutputStream out,
                                      long timeoutMillis)

      Create a new `OutputStreamFunneler` for the specified `OutputStream`, with the specified timeout value.
      Parameters:
        `out` - `OutputStream`.
        `timeoutMillis` - `long`.
      See Also:
        `setTimeout(long)`

  - ### Method Detail

    - #### setTimeout

          public void setTimeout(long timeoutMillis)

      Set the timeout for this `OutputStreamFunneler`. This is the maximum time that may elapse between the closure of the last "funnel" and the next call to `getOutputStream()` without closing the underlying stream.
      Parameters:
        `timeoutMillis` - `long` timeout value.

    - #### getFunnelInstance

          public java.io.OutputStream getFunnelInstance()
                                                 throws java.io.IOException

      Get a "funnel" `OutputStream` instance to write to this `OutputStreamFunneler`'s underlying `OutputStream`.
      Returns:
        `OutputStream`.
      Throws:
        `java.io.IOException` - if unable to create the funnel.