Stack Exchange
boost::iostream bzip2_decompressor not decompressing file compressed by bzip2_compressor
boost::iostream bzip2_decompressor not decompressing file compressed by bzip2_compressor

The SSCCE... I think you forgot it

http://www.boost.org/doc/libs/1_46_0/libs/iostreams/doc/classes/bzip2.html It is based on this link.

What's your point? We should do it for you?

Here's a simple self-contained example showing it to work:
Live On Coliru
#include <iostream>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/filter/bzip2.hpp>
#include <sstream>

namespace io = boost::iostreams;

int main()
{
    std::stringstream ss;

    {
        io::filtering_stream<io::output> of;
        of.push(io::bzip2_compressor{});
        of.push(ss);

        io::copy(std::cin, of);
    }

    std::cout << "Compressed input: " << ss.str().size() << " bytes\n";

    ss.seekg(0ul);
    {
        io::filtering_stream<io::input> if_;
        if_.push(io::bzip2_decompressor{});
        if_.push(ss);

        io::copy(if_, std::cout);
    }
}

On Coliru it shows it compresses itself to 331 bytes, and back again to stdout
Perhaps you are forgetting to flush, have non-binary, whitespace skipping. We can't tell without a SSCCE

What is 0ul here ? I'd like to do while writing: of.write() and while reading if_.read() ? so that I can specifiy how many bytes to read at ones. I'd like to write in a compressed binary file named abc.dat.bz2 and then again read from it abc.dat.bz2. and recFile_ is std::ofstream recFile_ to directly write in a file. and base file re_baseFile is std::ifstream.

Added SSCCE. kindly check it.
