Jump to content

  • Log In with Google      Sign In   
  • Create Account

How to use std::ostream and std::istream binary mode


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1   Members   

1173
Like
0Likes
Like

Posted 26 January 2012 - 04:42 PM

I'm trying to write a save/serialization system for my game, and I want to be able to serialize in binary mode. How can I do that? I know how to create binary ifstream and ofstream objects. Is it possible to do the same with regular ostream and istream?

#2   Moderators   

10730
Like
0Likes
Like

Posted 26 January 2012 - 05:26 PM

The "binary" flag just means that newlines aren't translated to the platform specific sequence during output. You can use istream::read() and ostream::write() to serialize byte data.

#3 wood_brian   Banned   

193
Like
-3Likes
Like

Posted 30 January 2012 - 11:36 AM

I'm trying to write a save/serialization system for my game, and I want to be able to serialize in binary mode. How can I do that?



The C++ Middleware Writer can help with this and is often more efficient than another approach --
http://webEbenezer.net/comparison.html .


Brian
Ebenezer Enterprises
http://webEbenezer.net




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.