| View previous topic :: View next topic |
| Author |
Message |
Agostino Guest
|
Posted: Tue Jan 27, 2004 5:20 pm Post subject: Write the buffer of a TMemoryStream in a TFileStream |
|
|
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
|
Posted: Tue Jan 27, 2004 5:36 pm Post subject: Re: Write the buffer of a TMemoryStream in a TFileStream |
|
|
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
|
Posted: Tue Jan 27, 2004 6:03 pm Post subject: Re: Write the buffer of a TMemoryStream in a TFileStream |
|
|
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
|
Posted: Wed Jan 28, 2004 2:09 am Post subject: Re: Write the buffer of a TMemoryStream in a TFileStream |
|
|
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
|
Posted: Wed Jan 28, 2004 4:08 am Post subject: Re: Write the buffer of a TMemoryStream in a TFileStream |
|
|
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 |
|
 |
|