help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'Classes' (#rtl)

TCustomMemoryStream.SaveToStream

Writes the contents of the memory stream to another stream.

Declaration

Source position: classesh.inc line 687

public procedure TCustomMemoryStream.SaveToStream(

  Stream: TStream

);

Description

SaveToStream writes the contents of the memory stream to Stream. The content of Stream is not cleared first. The current position of the memory stream is not changed by this action.

Remark:

This method will work much faster than the use of the TStream.CopyFrom method:

Seek(0,soFromBeginning);
  Stream.CopyFrom(Self,Size);

because the CopyFrom method copies the contents in blocks, while SaveToStream writes the contents of the memory as one big block.

Errors

If an error occurs when writing to Stream an EStreamError exception will be raised.

See also

TCustomMemoryStream.SaveToFile

  

Writes the contents of the stream to a file.

TStream.CopyFrom

  

Copy data from one stream to another

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505