THPDFRandomAccessSource.ReadAtCancellable Method
Reads bytes at Offset while observing a cancellation token before and after the underlying read
Declaration
function ReadAtCancellable(Offset: Int64; var Buffer; Count: Longint;
CancellationToken: THPDFCancellationToken): Longint; virtual;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
Offset | Zero-based byte offset to read from |
Buffer | Untyped buffer that receives the bytes |
Count | Maximum number of bytes to read |
CancellationToken | Token polled for cancellation, or nil to read without cancellation checks |
Return value
Number of bytes read, as reported by ReadAt
Usage notes
- The base implementation raises the cancellation exception before and after
ReadAtwhen the token is signaled - Override in slow sources such as network or archive-backed inputs to poll the token between transport chunks
- Deterministic replay wraps this method so recorded runs reproduce the same cancellation decisions