THPDFCompressedSpillStream
Provides a seekable temporary stream for payloads that should not remain fully resident in memory
Declaration
constructor Create(
BlockBytes: Integer = 262144;
BatchBytes: Integer = 1048576;
MaxQueuedBytes: Integer = 4194304);
Storage model
- Each logical block is compressed independently with a fast Flate strategy
- A block remains raw when compression would add at least 32 bytes of overhead
- Sequential writes enqueue complete blocks and a worker drains multiple blocks per batch
- The producer waits only when outstanding raw blocks reach
MaxQueuedBytes - Reads, flushes, random overwrites, and resizes synchronise only when they require a stable block index
- A random overwrite reuses the current physical slot when the replacement fits and otherwise appends a new block version
- The owned temporary file is deleted by the destructor
Statistics
GetStatistics fills THPDFSpillStatistics with logical and physical bytes, current compressed and raw block counts, asynchronous batch and block counts, producer waits, and peak queued bytes
See also: THPDFLazyFileStream, LoadedStreamMemoryThreshold, GetLoadedStreamCacheInfo