BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Write the buffer of a TMemoryStream in a TFileStream

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design
View previous topic :: View next topic  
Author Message
Agostino
Guest





PostPosted: Tue Jan 27, 2004 5:20 pm    Post subject: Write the buffer of a TMemoryStream in a TFileStream Reply with quote



I keep storing data in a TMemoryStream because I don't want to store it into
a file immediately but at the end of the process.
Then I want to write down to disk the stream. How am I suppose to do this?
Thanks
Agostino








Back to top
Marc Rohloff
Guest





PostPosted: Tue Jan 27, 2004 5:36 pm    Post subject: Re: Write the buffer of a TMemoryStream in a TFileStream Reply with quote



Agostino wrote on Tue, 27 Jan 2004 18:20:10 +0100 ...
<40169dcb (AT) newsgroups (DOT) borland.com>

Quote:
I keep storing data in a TMemoryStream because I don't want to store it into
a file immediately but at the end of the process.
Then I want to write down to disk the stream. How am I suppose to do this?

At the end of the process create a TFileStream and use it's CopyFrom
method.

Marc Rohloff
marc rohloff at bigfoot dot com

Back to top
Wayne Niddery [TeamB]
Guest





PostPosted: Tue Jan 27, 2004 6:03 pm    Post subject: Re: Write the buffer of a TMemoryStream in a TFileStream Reply with quote



Agostino wrote:
Quote:
I keep storing data in a TMemoryStream because I don't want to store
it into a file immediately but at the end of the process.
Then I want to write down to disk the stream. How am I suppose to do
this? Thanks

TMemoryStream.SaveToFile.

--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: http://www.logicfundamentals.com/RADBooks.html
"It is error alone which needs the support of government. Truth can
stand by itself." - Thomas Jefferson



Back to top
Nick Hodges (TeamB)
Guest





PostPosted: Wed Jan 28, 2004 2:09 am    Post subject: Re: Write the buffer of a TMemoryStream in a TFileStream Reply with quote

Wayne Niddery [TeamB] wrote:

Quote:
TMemoryStream.SaveToFile.

MyMemoryStream.Postion := 0;
MyMemoryStreasm.SaveToFile;

;-)

--
Nick Hodges (TeamB)
Lemanix Corporation - (http://www.lemanix.com)
Improve the quality of Delphi! Get your bugs into QC:
http://qc.borland.com

Back to top
Rob Kennedy
Guest





PostPosted: Wed Jan 28, 2004 4:08 am    Post subject: Re: Write the buffer of a TMemoryStream in a TFileStream Reply with quote

Nick Hodges (TeamB) wrote:
Quote:
Wayne Niddery [TeamB] wrote:
TMemoryStream.SaveToFile.

MyMemoryStream.Postion := 0;
MyMemoryStreasm.SaveToFile;

Not necessary. SaveToStream and SaveToFile always save the entire stream
contents. The current position is neither used nor modified.

--
Rob

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.