TECLMemoryStream.Read
TECLMemoryStream
Reads up to Count bytes from the memory stream into Buffer and advances the current position of the stream by the number of bytes read.
function Read(var Buffer; Count: Longint): Longint; override;
Description
Use Read to read the decompressed contents of the memory stream into a buffer, starting at the current position. Read will read up to Count bytes from the current position in memory. If Count bytes extends beyond the end of the memory buffer, Read will only transfer the data up to the end of the associated memory buffer. Read returns the number of bytes actually transferred to Buffer, and advances the current position accordingly. If the return value is less than Count, it means that reading reached the end of the stream data.
All the other data-reading methods of the memory stream (ReadBuffer, ReadComponent) call Read to do the actual reading.
Note:
Read treats Count as an upper bound. The ReadBuffer method, by contrast, raises an exception if Count bytes cannot be read.
|