TByteRangeStream availability queries
Document management, Progressive loading, Performance
Description
Tests whether an absolute byte range is cached or immediately available from the backing source without reading it
Syntax
Delphi
Function TByteRangeStream.IsRangeCached(Offset, Count: Int64): Boolean;
Function TByteRangeStream.IsRangeAvailable(Offset, Count: Int64): Boolean;Parameters
| Offset | The absolute zero-based start offset |
|---|---|
| Count | The number of consecutive bytes to test |
Return values
| False | The range is invalid, is not fully cached, or cannot be confirmed as immediately available |
|---|---|
| True | The complete range satisfies the selected query |
Remarks
IsRangeCached checks retained cache windows only
IsRangeAvailable first accepts cached coverage, then asks an IPLByteRangeAvailabilitySource about each uncovered aligned segmentNeither method reads source bytes, changes the positional stream cursor or mutates cache statisticsA zero-length range at a valid source offset is available