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



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

TMemoryStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Standard implementation of a stream that stores its data in memory

Declaration

Source position: classesh.inc line 694

type TMemoryStream = class(TCustomMemoryStream)

public

  destructor Destroy; override;

  

Frees any allocated memory and destroys the memory stream.

  procedure Clear;

  

Zeroes the position, capacity and size of the stream.

  procedure LoadFromStream();

  

Loads the contents of a stream into memory.

  procedure LoadFromFile();

  

Loads the contents of a file into memory.

  procedure SetSize(); override;

  

Sets the size for the memory stream.

  function Write(); override;

  

Writes data to the stream's memory.

end;

Inheritance

TMemoryStream

  

Standard implementation of a stream that stores its data in memory

|

TCustomMemoryStream

  

Abstract stream that stores its data in memory.

|

TStream

  

Base class for streams.

|

TObject

Description

TMemoryStream is a TStream descendent that stores it's data in memory. It descends directly from TCustomMemoryStream and implements the necessary to allocate and de-allocate memory diretly from the heap. It implements the Write method which is missing in TCustomMemoryStream.

TMemoryStream also introduces methods to load the contents of another stream or a file into the memory stream.

It is not necessary to do any memory management manually, as the stream will allocate or de-allocate memory as needed. When the stream is freed, all allocated memory will be freed as well.

See also

TCustomMemoryStream

  

Abstract stream that stores its data in memory.

TStream

  

Base class for streams.

Notes

 No notes exist for this page yet. 





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