diff --git a/dbms/include/DB/IO/copyData.h b/dbms/include/DB/IO/copyData.h new file mode 100644 index 00000000000..c4e50bdff47 --- /dev/null +++ b/dbms/include/DB/IO/copyData.h @@ -0,0 +1,17 @@ +#ifndef DBMS_IO_COPY_DATA_H +#define DBMS_IO_COPY_DATA_H + +#include +#include + + +namespace DB +{ + +/** Копирует данные из ReadBuffer в WriteBuffer + */ +void copyData(ReadBuffer & from, WriteBuffer & to); + +} + +#endif diff --git a/dbms/src/IO/copyData.cpp b/dbms/src/IO/copyData.cpp new file mode 100644 index 00000000000..ed31f4fa8dc --- /dev/null +++ b/dbms/src/IO/copyData.cpp @@ -0,0 +1,16 @@ +#include + + +namespace DB +{ + +void copyData(ReadBuffer & from, WriteBuffer & to) +{ + while (!from.eof()) + { + to.write(from.buffer().begin(), from.buffer().end() - from.buffer().begin()); + from.position() = from.buffer().end(); + } +} + +}