#include #include #include #include #include #include #include int main(int argc, char ** argv) { if (argc > 2 || (argc == 2 && strcmp(argv[1], "-d"))) { std::cerr << "Usage: " << argv[0] << " [-d] < in > out" << std::endl; return 1; } Poco::SharedPtr rb = new DB::ReadBufferFromIStream(std::cin); Poco::SharedPtr wb = new DB::WriteBufferFromOStream(std::cout); Poco::SharedPtr from; Poco::SharedPtr to; if (argc == 1) { /// Сжатие from = rb; to = new DB::CompressedWriteBuffer(*wb); } else { /// Разжатие from = new DB::CompressedReadBuffer(*rb); to = wb; } DB::copyData(*from, *to); return 0; }