Class UncheckedFilterOutputStream

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

    public final class UncheckedFilterOutputStream
    extends java.io.FilterOutputStream
    A FilterOutputStream that throws UncheckedIOException instead of UncheckedIOException.

    To build an instance, use UncheckedFilterOutputStream.Builder.

    Since:
    2.12.0
    See Also:
    UncheckedFilterOutputStream.Builder, FilterOutputStream, UncheckedIOException
    • Constructor Detail

      • UncheckedFilterOutputStream

        private UncheckedFilterOutputStream​(UncheckedFilterOutputStream.Builder builder)
                                     throws java.io.IOException
        Constructs an output stream filter built on top of the specified underlying output stream.
        Parameters:
        builder - the buider.
        Throws:
        java.io.IOException - if an I/O error occurs converting to an OutputStream using #getOutputStream().
    • Method Detail

      • close

        public void close()
                   throws java.io.UncheckedIOException
        Calls this method's super and rethrow IOException as UncheckedIOException.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.FilterOutputStream
        Throws:
        java.io.UncheckedIOException
      • flush

        public void flush()
                   throws java.io.UncheckedIOException
        Calls this method's super and rethrow IOException as UncheckedIOException.
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.FilterOutputStream
        Throws:
        java.io.UncheckedIOException
      • write

        public void write​(byte[] b)
                   throws java.io.UncheckedIOException
        Calls this method's super and rethrow IOException as UncheckedIOException.
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.UncheckedIOException
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
                   throws java.io.UncheckedIOException
        Calls this method's super and rethrow IOException as UncheckedIOException.
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.UncheckedIOException
      • write

        public void write​(int b)
                   throws java.io.UncheckedIOException
        Calls this method's super and rethrow IOException as UncheckedIOException.
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.UncheckedIOException