RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TStringStream.Read Method

Reads up to Count bytes from the string stream into Buffer, and advances the current position of the stream by the number of bytes read.

Pascal
function Read(var Buffer; Count: Longint): Longint; override;
C++
virtual __fastcall Longint Read( Buffer, Longint Count);

Use Read to read the contents of the string stream into a buffer, starting at the current position. If Count extends beyond the end of the DataString, Read will only transfer the characters up to the end of the DataString, and advances the current position accordingly. If the return value is less than Count, it means that the end of the string was read. 

The ReadBuffer method and ReadComponent method 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.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!