public class FileStreamFactory extends StreamFactory
FileStream
instances on demand. This type is used by
classes that need to work with data from a stream from multiple threads simultaneously.
They can use it to open the stream in each thread.Constructor and Description |
---|
FileStreamFactory(agi.foundation.compatibility.Func1<FileStream> func)
Initializes a new instance with a provided delegate.
|
FileStreamFactory(String path,
FileMode mode)
Initializes a new instance of the factory that constructs a new
FileStream with
FileStream.FileStream(String,FileMode) when FileStreamFactory.openStream()
is called. |
FileStreamFactory(String path,
FileMode mode,
FileAccess access)
Initializes a new instance of the factory that constructs a new
FileStream with
FileStream.FileStream(String,FileMode,FileAccess) when FileStreamFactory.openStream()
is called. |
Modifier and Type | Method and Description |
---|---|
FileStream |
openFileStream()
Opens a new
FileStream . |
InputStream |
openStream()
Opens a new
InputStream . |
public FileStreamFactory(@Nonnull String path, @Nonnull FileMode mode)
FileStream
with
FileStream.FileStream(String,FileMode)
when FileStreamFactory.openStream()
is called.path
- The 'path' parameter passed to the FileStream
constructor.mode
- The 'mode' parameter passed to the FileStream
constructor.public FileStreamFactory(@Nonnull String path, @Nonnull FileMode mode, @Nonnull FileAccess access)
FileStream
with
FileStream.FileStream(String,FileMode,FileAccess)
when FileStreamFactory.openStream()
is called.path
- The 'path' parameter passed to the FileStream
constructor.mode
- The 'mode' parameter passed to the FileStream
constructor.access
- The 'access' parameter passed to the FileStream
constructor.public FileStreamFactory(@Nonnull agi.foundation.compatibility.Func1<FileStream> func)
func
- The function to call in order to open a file stream.ArgumentNullException
- Thrown when func
is null
.public InputStream openStream()
InputStream
.openStream
in class StreamFactory
@Nonnull public FileStream openFileStream()
FileStream
.