THPDFRandomAccessSource.ReadAt Method
Reads Count bytes starting at the supplied zero-based Offset into Buffer
Declaration
function ReadAt(Offset: Int64; var Buffer;
Count: Longint): Longint; virtual; abstract;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
Offset | Zero-based byte offset at which to begin reading; must be within the range reported by GetSize |
Buffer | Untyped var buffer that receives the bytes; the caller guarantees it can hold at least Count bytes |
Count | Maximum number of bytes to transfer |
Return value
The number of bytes actually transferred, from zero through Count. A short read at the documented end of file is treated as end-of-stream, not as an error
Usage notes
- Override this method in a subclass to fetch bytes on demand from your backing store (HTTP range request, database
SELECT ... OFFSET, archive member slice, virtual volume mapping) - HotPDF seeks through the cross-reference tables and object streams by calling
ReadAtat absolute offsets, so the implementation must honour anyOffsetup toGetSize - 1 - Returning more than
Countbytes is a contract violation; return exactly the bytes available up toCount