Function createCachedFileStream
Creates a new CachedStream
instance.
CachedFileStream!InputStream createCachedFileStream(InputStream)
(
InputStream source,
Flag!"writable" writable = No .writable
)
if (isInputStream!InputStream);
CachedFileStream!InputStream createCachedFileStream(InputStream)
(
InputStream source,
NativePath cached_file_path,
Flag!"writable" writable = No .writable
)
if (isInputStream!InputStream);
Data will be read as needed from the source stream sequentially and gets
stored in the local file for random access. Note that the reported size
of the stream may change for source streams that do not report their full
size through the leastSize
property.
Also note that when making the cached file writable, parts of the file that have not yet been read from the source stream will get overwritten after write operations to the cached file. Write operations should ideally only be made after reading the complete source stream.
Parameters
Name | Description |
---|---|
source | The source input stream to read from |
writable | Optional flag to make the cached file writable |
cached_file_path | Explicit path for storing the cached file - if not given, uses a temporary file that gets deleted upon close |