|
Boost Users : |
From: Nat Goodspeed (ngoodspeed_at_[hidden])
Date: 2006-08-25 13:44:32
> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of smith smithson
> Sent: Friday, August 25, 2006 10:43 AM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] Boost serialization : Stream error
exception
>
> I figured out what the problem is; I use a buffered
> version of iostream/stream_buf to buffer data from my
> mmap'd file and pass it out when requested. For some
> reason if the very first character in the buffer is
> character 255 (an extended ascii character) in any of
> the buffers, I get the stream error exception. Any
> suggestions why this might happen? Is this reserved in
> some way? I see the issue in both text mode and binary
> mode.
[Nat] Do you have access to the source code to your buffered version of
stream_buf? Is the buffer declared as an array of char? Does char
default to signed with your compiler? If so, char 255 == 0xFF can get
returned as the int value -1 -- which is still used as EOF in the stream
code I've poked through.
Sorry if this is way off base, but I've been bitten before by not using
unsigned char for buffers containing bytes with high-order bits set.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net