Wikia

Delphi Programming

TMemoryStream Class

2,918pages on
this wiki
Talk0
This page is intended as a supplement to the official documentation on Delphi programming. CodeGear is in the process of putting the Delphi documentation on the Web. Once they have done so, this page will link to the relevant page in the official documentation.
Stub
This article is a stub.
Please help enhance the Delphi Programming Wiki by expanding it.
Info
see the VCL Documentation Guidelines for an overview on doc pages

UnitEdit

HierarchyEdit

DescriptionEdit

TMemoryStream is descendant of TStream class for manipulating data in memory. This class introduce read-only property called Memory which is pointer type so you can get direct access to memory maintained by TMemoryStream.

Technical CommentsEdit

(Known issues / Documentation clarifications / Things to be aware of)

ExamplesEdit

Load data from file to memory

 procedure LoadFromFileToMem(const filename:string; memStream:TMemoryStream);
 var afileStream:TFileStream;
 begin
   afileStream:=TFileStream.Create(filename,fmOpenRead);
   try
     memStream.CopyFrom(afileStream);
   finally
     afileStream.Free;
   end;
 end;
 ...
 var 
   memStream:TMemoryStream;
 ...
 memStream:=TMemoryStream.Create;
 try
   LoadFromFileToMem('C\my file.dat',memStream);  
 finally
   memStream.Free;
 end;


mo funciona

trem feio

See AlsoEdit

User Comments/TipsEdit

(Please leave your name with your comment.)

Around Wikia's network

Random Wiki