Does boost have something to support binary data streams?

I commonly need to write and read binary data from files. The streams in the standard library are very tedious to use for such tasks. I'd like to be able to construct a stream thats loads a little endian binary data file and use it to write/read data with the insertion/extraction operators on big endian or little endian systems. Does anything like this exists? Thanks, Michael Marcin

On 2/9/07, Michael Marcin
I commonly need to write and read binary data from files. The streams in the standard library are very tedious to use for such tasks. I'd like to be able to construct a stream thats loads a little endian binary data file and use it to write/read data with the insertion/extraction operators on big endian or little endian systems.
I don't think there are any current libraries for this. Beman Dawes made a library that might be useful, however: http://www.boost-consulting.com/vault/index.php?direction=0&order=&directory=Integer HTH ~ Scott McMurray

Hmmm - sounds to me like you want the serialization library. Robert Ramey me22 wrote:
On 2/9/07, Michael Marcin
wrote: I commonly need to write and read binary data from files. The streams in the standard library are very tedious to use for such tasks. I'd like to be able to construct a stream thats loads a little endian binary data file and use it to write/read data with the insertion/extraction operators on big endian or little endian systems.
I don't think there are any current libraries for this.
Beman Dawes made a library that might be useful, however: http://www.boost-consulting.com/vault/index.php?direction=0&order=&directory=Integer
HTH
~ Scott McMurray

On 2/10/07, Robert Ramey
On 2/9/07, Michael Marcin
wrote: I commonly need to write and read binary data from files. The streams in the standard library are very tedious to use for such tasks. I'd like to be able to construct a stream thats loads a little endian binary data file and use it to write/read data with the insertion/extraction operators on big endian or little endian systems.
Hmmm - sounds to me like you want the serialization library.
In my recollection, the binary archives in Boost.Serialization don't handle type size differences or endianness.

The library includes a demo/example - portable archive which does handle differences and and endian-ness - EXCEPT for floats/doubles. Finishing this wouldn't be tooooo hard, but no one has had sufficient interest to do this. Robert Ramey me22 wrote:
On 2/10/07, Robert Ramey
wrote: On 2/9/07, Michael Marcin
wrote: I commonly need to write and read binary data from files. The streams in the standard library are very tedious to use for such tasks. I'd like to be able to construct a stream thats loads a little endian binary data file and use it to write/read data with the insertion/extraction operators on big endian or little endian systems.
Hmmm - sounds to me like you want the serialization library.
In my recollection, the binary archives in Boost.Serialization don't handle type size differences or endianness.

"Robert Ramey"
Hmmm - sounds to me like you want the serialization library.
The serialization library looks nice but I didn't think it was designed for this task, although I admit I haven't finished its documentation. The general problem is I have binary data comming out of a 3rd party tool that I need to import and convert to something the application can work with. Also several different formats of binary input data can be imported and have the same representation in the application. Is this a good match for serialization? Thanks, Michael Marcin

On Sat, Feb 10, 2007 at 04:55:52PM -0600, Michael Marcin wrote:
"Robert Ramey"
wrote in message news:eqjtbp$j2c$1@sea.gmane.org... Hmmm - sounds to me like you want the serialization library.
The serialization library looks nice but I didn't think it was designed for this task, although I admit I haven't finished its documentation.
The general problem is I have binary data comming out of a 3rd party tool that I need to import and convert to something the application can work with. Also several different formats of binary input data can be imported and have the same representation in the application.
Is this a good match for serialization?
No, it isn't. I haven't seen the library posted in the sandbox, hopefully that is closer to what you really need. Jeff -- ---------------------------------------------------------------------------- Computer Science is as much about computers as astronomy is about telescopes -- Edsger Wybe Dijkstra (1930-2002) ----------------------------------------------------------------------------

Michael Marcin wrote:
The general problem is I have binary data comming out of a 3rd party tool that I need to import and convert to something the application can work with. Also several different formats of binary input data can be imported and have the same representation in the application.
Is this a good match for serialization?
Well, once you put that way I'd have to answer no. Robert Ramey

me22 wrote:
On 2/9/07, Michael Marcin
wrote: I commonly need to write and read binary data from files. The streams in the standard library are very tedious to use for such tasks. I'd like to be able to construct a stream thats loads a little endian binary data file and use it to write/read data with the insertion/extraction operators on big endian or little endian systems.
I don't think there are any current libraries for this.
I'm sort of surprised more people don't need this... maybe they just roll their own?
Beman Dawes made a library that might be useful, however: http://www.boost-consulting.com/vault/index.php?direction=0&order=&directory=Integer
I'll take a look, thanks. - Michael Marcin
participants (5)
-
Jeffrey Brent McBeth
-
me22
-
Michael Marcin
-
Michael Marcin
-
Robert Ramey