Boost logo

Boost :

From: Olaf van der Spek (olafvdspek_at_[hidden])
Date: 2006-03-28 10:24:17


On 3/28/06, Caleb Epstein <caleb.epstein_at_[hidden]> wrote:
> On 3/28/06, Olaf van der Spek <olafvdspek_at_[hidden]> wrote:
>
> When reading/writing binary streams, you often need to read/write an
> > (unaligned) integer in big, little or native endian. Is there support
> > for this in Boost?
>
>
> The closest thing I'm aware of is the portable_binary_oarchive (and
> iarchive) in the Boost.Serialization examples directory. This has logic to
> save integers and longs in little-endian format regardless of the hardware
> architecture, saving a single byte length + binary data that represents the
> value. For example, 42 would be saved as \x01\x2a and 1024 would be saved
> as \x02\x00\x04

Is the code/function that writes the binary value (without the length)
also available in the interface or only in the implementation?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk