Class FileDeferredOutputStream

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

    public class FileDeferredOutputStream
    extends DeferredOutputStream
    A deferred output stream that uses a file as its backing store, with a in-memory intermediate buffer.
    • Constructor Detail

      • FileDeferredOutputStream

        public FileDeferredOutputStream​(@Nonnull
                                        java.io.File backingFile)
                                 throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • FileDeferredOutputStream

        public FileDeferredOutputStream​(@Nonnull
                                        java.io.File backingFile,
                                        int bufferSize)
                                 throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
    • Method Detail

      • writeTo

        public void writeTo​(@Nonnull
                            java.io.OutputStream dest)
                     throws java.io.IOException
        Specified by:
        writeTo in class DeferredOutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(int i)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] bytes)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] bytes,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.OutputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream
        Throws:
        java.io.IOException
      • getFactory

        @Nonnull
        public static DeferredOutputStreamFactory getFactory​(@Nullable
                                                             java.io.File containingDirectory,
                                                             int bufferSize)