Class FilterOutputStream2

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

    public abstract class FilterOutputStream2
    extends OutputStream
    A FilterOutputStream2 contains another OutputStream, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality.

    Note: unlike FilterOutputStream this class delegates every method by default. This means to transform write calls, you need to override multiple methods. On the other hand, it is less trappy: a simple implementation that just overrides close will not force bytes to be written one-at-a-time.