1 | #include <iostream> |
---|---|
2 | |
3 | #include <IO/ReadBufferFromFileDescriptor.h> |
4 | #include <IO/WriteBufferFromFileDescriptor.h> |
5 | #include <IO/AsynchronousWriteBuffer.h> |
6 | #include <IO/copyData.h> |
7 | #include <Compression/CompressedWriteBuffer.h> |
8 | |
9 | |
10 | int main(int, char **) |
11 | try |
12 | { |
13 | DB::ReadBufferFromFileDescriptor in1(STDIN_FILENO); |
14 | DB::WriteBufferFromFileDescriptor out1(STDOUT_FILENO); |
15 | DB::AsynchronousWriteBuffer out2(out1); |
16 | DB::CompressedWriteBuffer out3(out2); |
17 | |
18 | DB::copyData(in1, out3); |
19 | |
20 | return 0; |
21 | } |
22 | catch (const DB::Exception & e) |
23 | { |
24 | std::cerr << e.what() << ", "<< e.displayText() << std::endl; |
25 | return 1; |
26 | } |
27 |