id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 5630,base64 encode/decode for std::istreambuf_iterator/std::ostreambuf_iterator,nen777w@…,Robert Ramey,"MSVS 2008 The code: {{{ #include ""boost/archive/iterators/base64_from_binary.hpp"" #include ""boost/archive/iterators/binary_from_base64.hpp"" #include ""boost/archive/iterators/transform_width.hpp"" //typedefs typedef std::istreambuf_iterator my_istream_iterator; typedef std::ostreambuf_iterator my_ostream_iterator; typedef boost::archive::iterators::base64_from_binary< boost::archive::iterators::transform_width< my_istream_iterator, 6, 8> > bin_to_base64; typedef boost::archive::iterators::transform_width< boost::archive::iterators::binary_from_base64< my_istream_iterator >, 8, 6 > base64_to_bin; void test() { { //INPUT FILE!!! std::ifstream ifs(""test.zip"", std::ios_base::in|std::ios_base::binary); std::ofstream ofs(""test.arc"", std::ios_base::out|std::ios_base::binary); std::copy( bin_to_base64( my_istream_iterator(ifs >> std::noskipws) ), bin_to_base64( my_istream_iterator() ), my_ostream_iterator(ofs) ); } { std::ifstream ifs(""test.arc"", std::ios_base::in|std::ios_base::binary); std::ofstream ofs(""test.rez"", std::ios_base::out|std::ios_base::binary); std::copy( base64_to_bin( my_istream_iterator(ifs >> std::noskipws) ), base64_to_bin( my_istream_iterator() ), my_ostream_iterator(ofs) ); } } }}} Result: 1) If the INPUT FILE will be any of ZIP-file format. The result was: a) _DEBUG_ERROR(""istreambuf_iterator is not dereferencable""); //it can be disabled or ignored b) The encoded file ""test.rez"" will have one superfluous byte than INPUT FILE 2) If the INPUT FILE will any other file (binary or text) all will be OK. ",Bugs,closed,To Be Determined,serialization,Boost 1.45.0,Problem,duplicate,,