-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of smith smithson Sent: Friday, August 25, 2006 10:43 AM To: boost-users@lists.boost.org 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.