Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » How to use FileStream?
Re: How to use FileStream? [message #8207 is a reply to message #8206] Mon, 19 February 2007 04:15 Go to previous messageGo to previous message
Ulti is currently offline  Ulti
Messages: 108
Registered: September 2006
Experienced Member
Sorry,it's my stupid,I just forget to save the buffer into filestream.

but I wonder if my idea is the best one,hope you can give some advice:

I have a buffer which hold 512byte character,and I want save it into file like this way
void CompoundFile::Header::ToBuf(MemStream &buf)
{
buf.Put64le(MagicId);
buf.Put64le(UID1);
buf.Put64le(UID2);
buf.Put16le(rev);
buf.Put16le(ver);
buf.Put16le(byteorder);
buf.Put16le(ssz);
buf.Put16le(sssz);
buf.Put16le(notused1);
buf.Put64le(notused2);
buf.Put32le(SATSecCnt);
buf.Put32le(DirStartSID);
buf.Put32le(notused3);
buf.Put32le(StdStreamSize);
buf.Put32le(SSATStartSID);
buf.Put32le(SSATSecCnt);
buf.Put32le(MSAT1StartSID);
buf.Put32le(MSAT1SecCnt);
buf.Put32le(MSAT1SecCnt);
for(int i=0;i<109;i++)
buf.Put32le(MSAT0[i]);
}
first I put this 512byte into MemStream,and then use the already exist method to write big/little endian,and then put this MemStream into FileStream.
is this is the best way,or any other good ideas(I don't want write any other endian function,they are already in Stream)?


thanks a lot!

[Updated on: Mon, 19 February 2007 04:16]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problem with Serialization after recompiling with U++ 2007.1beta3
Next Topic: something abaut brc file
Goto Forum:
  


Current Time: Mon Aug 25 19:41:29 CEST 2025

Total time taken to generate the page: 0.06088 seconds