IPLByteRangePrefetchReadControl

Data types

Description

Read-only view of the stream and the running job that the planner receives on every planning pass

It exposes the source size, the chunk granularity used for reads, a range read entry point and the job cancellation state

Syntax

Delphi

IPLByteRangePrefetchReadControl = Interface
  Function GetTotalSize: Int64;
  Function GetChunkSize: Integer;
  Function ReadRange(StartOffset: Int64; Count: Integer;
    Buffer: PAnsiChar): Integer;
  Function IsRangeAvailable(StartOffset: Int64; Count: Integer): Boolean;
  Function IsCancelled: Boolean;
End;

Remarks

GetTotalSize returns the source length and GetChunkSize the target read granularity

ReadRange places up to Count bytes into the caller buffer and returns the number of bytes copied

IsCancelled becomes True once CancelPrefetch is called for the job, so a long planning pass can stop early

See also

IPLByteRangePrefetchPlanner, StartPrefetch, CancelPrefetch, GetPrefetchInfo