IsRangeCached

Document management, Performance, Concurrency

Description

Tests whether every byte of an absolute range is covered by chunks currently retained in the cache

The query reads no source bytes, leaves the positional cursor alone and does not change the cache statistics or the recency order of the chunks

Syntax

Delphi

Function TByteRangeStream.IsRangeCached(Offset, Count: Int64): Boolean;

Parameters

OffsetThe absolute zero-based start offset
CountThe number of consecutive bytes to test

Return values

TrueThe complete range is cached, or Count is zero at a valid source offset
FalseThe offset or count is negative, the range extends past the source end, or part of the range is not cached

Remarks

A range that spans several retained chunks reports True as long as the chunks leave no gap

IsRangeAvailable additionally accepts bytes that the backing source reports as immediately available

See also

TByteRangeStreamAvailability, TByteRangeStreamReadAt, GetRangeSourceDataAvailability