[iostreams] Obfuscator
Hi all, I'm trying to make filter to obfuscate some data so its not that obvious what it is. Problem is (I think) that in some cases, the obfuscator produces a null character as its output, and I'm not sure, but it seems that upon reading back the data, the null character is interpreted as EOF. At least, that is what I get from boost::iostreams::get(src) at the position where the null character was in the output. Can I somehow tell the stream that it is binary and not care about null characters? TIA /Rob
You can set at least (to basic_file_source
http://www.boost.org/doc/libs/1_35_0/libs/iostreams/doc/classes/file.html#fi...)
that it should be opened in the binary mode.
I think you can pass any of the flags defined in std::ios_base::openmode. If
that does not work, try to unset skipws flag, which skips all white spaces
when reading stream, but that actually should not apply to binary stream at
all.
Best Regards,
Ovanes.
On Mon, Apr 21, 2008 at 2:29 PM, Robert Bielik
Hi all,
I'm trying to make filter to obfuscate some data so its not that obvious what it is. Problem is (I think) that in some cases, the obfuscator produces a null character as its output, and I'm not sure, but it seems that upon reading back the data, the null character is interpreted as EOF. At least, that is what I get from boost::iostreams::get(src) at the position where the null character was in the output. Can I somehow tell the stream that it is binary and not care about null characters?
TIA /Rob _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Ovanes Markarian skrev:
I think you can pass any of the flags defined in std::ios_base::openmode. If that does not work, try to unset skipws flag, which skips all white spaces when reading stream, but that actually should not apply to binary stream at all.
Tried using std::setiosflags(...) with the streams and that seems to work fine, thnx! /R
participants (2)
-
Ovanes Markarian
-
Robert Bielik