Class WriteCacheFileInputStream

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

    public class WriteCacheFileInputStream
    extends java.io.FilterInputStream
    FilterInputStream that dumps all data passed through it to a cache file before passing the data on.
    Author:
    P.J. Meisch ([email protected]).
    • Field Summary

      • Fields inherited from class java.io.FilterInputStream

        in
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected WriteCacheFileInputStream​(java.io.InputStream in, java.io.OutputStream out)
      Creates a FilterInputStream by assigning the argument in to the field this.in so as to remember it for later use.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void onInputStreamClose​(java.lang.Runnable r)  
      int read​(byte[] b, int off, int len)  
      • Methods inherited from class java.io.FilterInputStream

        available, mark, markSupported, read, read, reset, skip
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WriteCacheFileInputStream

        protected WriteCacheFileInputStream​(java.io.InputStream in,
                                            java.io.OutputStream out)
        Creates a FilterInputStream by assigning the argument in to the field this.in so as to remember it for later use.
        Parameters:
        in - the underlying input stream, or null if this instance is to be created without an underlying stream.
        out - the stream where the data read from in should be written to.
    • Method Detail

      • 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.FilterInputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • onInputStreamClose

        public void onInputStreamClose​(java.lang.Runnable r)