Package com.sothawo.mapjfx.offline
Class WriteCacheFileInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.sothawo.mapjfx.offline.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]).
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
WriteCacheFileInputStream(java.io.InputStream in, java.io.OutputStream out)
Creates aFilterInputStream
by assigning the argumentin
to the fieldthis.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
-
-
-
-
Constructor Detail
-
WriteCacheFileInputStream
protected WriteCacheFileInputStream(java.io.InputStream in, java.io.OutputStream out)
Creates aFilterInputStream
by assigning the argumentin
to the fieldthis.in
so as to remember it for later use.- Parameters:
in
- the underlying input stream, ornull
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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
onInputStreamClose
public void onInputStreamClose(java.lang.Runnable r)
-
-