[Overview][Constants][Types][Classes][Procedures and functions][Variables] |
Loads the contents of a stream into memory.
Source position: classesh.inc line 696
public procedure TMemoryStream.LoadFromStream( |
Stream: TStream |
); |
LoadFromStreamloads the contents of Streaminto the memorybuffer of the stream. Any previous contents of the memory stream are overwritten. Memory is allocated as needed.
Remark: | The LoadFromStreamuses the Sizeproperty of Streamto determine how much memory must be allocated. Some streams do not allow the stream size to be determined, so care must be taken when using this method. This method will work much faster than the use of the TStream.CopyFrommethod: Seek(0,soFromBeginning); CopyFrom(Stream,Stream.Size); because the CopyFrommethod copies the contents in blocks, while LoadFromStreamreads the contents of the stream as one big block. |
If an error occurs when reading from the stream, an EStreamErrormay occur.
|
Copy data from one stream to another |
|
|
Loads the contents of a file into memory. |