IPLByteRangeSource

Data types

Description

Contract a remote transport implements so the byte-range reader can load a PDF by absolute offsets

The total length must be known before the first range read so seek-based callers can size the stream; a short read is allowed only at end of file

Syntax

Delphi

IPLByteRangeSource = Interface
  Function GetTotalSize: Int64;
  Function ReadRange(StartOffset: Int64; Count: Integer;
    Buffer: PAnsiChar): Integer;
  Function GetRangeSupported: Boolean;
  Function GetLastError: AnsiString;
End;

Remarks

GetTotalSize returns the authoritative resource length; a negative value marks the size as unknown

ReadRange places up to Count bytes at StartOffset into Buffer and returns the number of bytes copied

GetRangeSupported reports whether the transport honours Range requests, and GetLastError returns human-readable text for the last transport failure

See also

IPLByteRangeAvailabilitySource, BuildLinearizedURLAccessPlan, LoadFromRangeSource, TByteRangeStreamReadAt