TMemoryStream class
Standard implementation of a stream that stores its data in memory.
Declaration
TMemoryStream = class(TCustomMemoryStream)Inheritance
- TMemoryStream
- TCustomMemoryStream
- TStream
- TObject
Descends from it: TBytesStream
Description
TMemoryStream is a
TStream descendant that stores
it's data in memory. It descends directly from
TCustomMemoryStream
and implements the necessary to allocate and de-allocate memory directly 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
Properties
Capacity | protected | Current capacity of the stream. |
Methods
Realloc | protected | Sets the new capacity for the memory stream. |
Destroy | public | Frees any allocated memory and destroys the memory stream. |
Clear | public | Zeroes the position, capacity and size of the stream. |
LoadFromStream | public | Loads the contents of a stream into memory. |
LoadFromFile | public | Loads the contents of a file into memory. |
SetSize | public | Sets the size for the memory stream. |
Write | public | Writes data to the stream's memory. |
Inherited
From TCustomMemoryStream (9)
GetPosition GetSize Memory Read SaveToFile SaveToStream Seek SetPointer SizeBoundsSeek
From TObject (41)
AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance Create DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
