org.entityfs.util.io
Class ReadableFileInputStreamFactory
java.lang.Object
org.entityfs.util.io.ReadableFileInputStreamFactory
- All Implemented Interfaces:
- ObjectFactory<InputStream>
public class ReadableFileInputStreamFactory
- extends Object
- implements ObjectFactory<InputStream>
This is a ObjectFactory
for InputStream
:s that creates input
streams that read from a ReadableFile
object.
For each new stream that is created, the backing file is locked for reading.
The stream that is returned is lock-aware, which means that the lock is
released when the stream is closed.
Since the locks are coupled to the threads that acquire them, an InputStream
created by this factory should only be used in the same thread
that created it.
- Author:
- Karl Gustafsson
- See Also:
LockAwareInputStream
- In_jar:
- entityfs-core
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReadableFileInputStreamFactory
public ReadableFileInputStreamFactory(ReadableFile f)
create
public InputStream create()
- Description copied from interface:
ObjectFactory
- Create a new instance of the object.
- Specified by:
create
in interface ObjectFactory<InputStream>
- Returns:
- The new instance.