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
    • Field Summary

      • Fields inherited from class java.io.FilterOutputStream

        out
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static UncheckedFilterOutputStream.Builder builder()
      void close()
      Calls this method's super and rethrow IOException as UncheckedIOException.
      void flush()
      Calls this method's super and rethrow IOException as UncheckedIOException.
      void write​(byte[] b)
      Calls this method's super and rethrow IOException as UncheckedIOException.
      void write​(byte[] b, int off, int len)
      Calls this method's super and rethrow IOException as UncheckedIOException.
      void write​(int b)
      Calls this method's super and rethrow IOException as UncheckedIOException.
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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