Package org.apache.commons.io.output

# Class FlushShieldOutputStream

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.commons.io.output.ProxyOutputStream
org.apache.commons.io.output.FlushShieldOutputStream

All Implemented Interfaces:
  `Closeable`, `Flushable`, `AutoCloseable`

public final class FlushShieldOutputStream extends ProxyOutputStream
Re-implements `FilterOutputStream.flush()` to do nothing.

Since:
  2.22.0

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `FlushShieldOutputStream.Builder`
  Builds a new `FlushShieldOutputStream`.

- ## Field Summary

  ### Fields inherited from class java.io.FilterOutputStream

  `out`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FlushShieldOutputStream(OutputStream out)`
  Constructs a `FlushShieldOutputStream` filter for the specified underlying output stream.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static FlushShieldOutputStream.Builder`
  `builder()`
  Constructs a new builder of `FlushShieldOutputStream`.
  `void`
  `flush()`
  Invokes the delegate's `flush()` method.

  ### Methods inherited from class org.apache.commons.io.output.ProxyOutputStream

  `afterWrite, beforeWrite, close, handleIOException, setReference, unwrap, write, write, write, writeRepeat, writeRepeat, writeRepeat`

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

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

- ## Constructor Details

  - ### FlushShieldOutputStream

    public FlushShieldOutputStream(OutputStream out)
    Constructs a `FlushShieldOutputStream` filter for the specified underlying output stream.
    Parameters:
      `out` - the underlying output stream to be assigned to the field `this.out` for later use, or `null` if this instance is to be created without an underlying stream.

- ## Method Details

  - ### builder

    public static FlushShieldOutputStream.Builder builder()
    Constructs a new builder of `FlushShieldOutputStream`.
    Returns:
      a new builder of `FlushShieldOutputStream`.

  - ### flush

    public void flush() throws IOException
    Description copied from class: `ProxyOutputStream`
    Invokes the delegate's `flush()` method.
    Specified by:
      `flush` in interface `Flushable`
    Overrides:
      `flush` in class `ProxyOutputStream`
    Throws:
      `IOException` - if an I/O error occurs.