Wraps a StreamHandle factory (e.g. () => provider.getReadableStream(path))
so the underlying source is read at most once - the first call drains the
source while caching every chunk in memory; every subsequent call replays
the cached chunks without touching the source again.
A plain StreamHandle only exposes a single one-shot ReadableStream, so
caching can't be a StreamDecorator<K, C> operating on an already-open
handle (there would be nothing left to re-read on a second call) - it has
to intercept the open operation itself, provider-agnostic regardless of
what kind of source is behind it.
Wraps a
StreamHandlefactory (e.g.() => provider.getReadableStream(path)) so the underlying source is read at most once - the first call drains the source while caching every chunk in memory; every subsequent call replays the cached chunks without touching the source again.A plain
StreamHandleonly exposes a single one-shotReadableStream, so caching can't be aStreamDecorator<K, C>operating on an already-open handle (there would be nothing left to re-read on a second call) - it has to intercept the open operation itself, provider-agnostic regardless of what kind of source is behind it.