createCachedFileStream

Creates a new CachedStream instance.

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.

  1. CachedFileStream!InputStream createCachedFileStream(InputStream source, Flag!"writable" writable)
    CachedFileStream!InputStream
    createCachedFileStream
    (
    InputStream
    )
    (
    InputStream source
    ,
    Flag!"writable" writable = No.writable
    )
    if (
    isInputStream!InputStream
    )
  2. CachedFileStream!InputStream createCachedFileStream(InputStream source, NativePath cached_file_path, Flag!"writable" writable)

Parameters

source InputStream

The source input stream to read from

writable Flag!"writable"

Optional flag to make the cached file writable

Meta