mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
dbms: added copyData function for Read/Write buffers.
This commit is contained in:
parent
74e423663a
commit
cb45d49d11
17
dbms/include/DB/IO/copyData.h
Normal file
17
dbms/include/DB/IO/copyData.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef DBMS_IO_COPY_DATA_H
|
||||
#define DBMS_IO_COPY_DATA_H
|
||||
|
||||
#include <DB/IO/ReadBuffer.h>
|
||||
#include <DB/IO/WriteBuffer.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
/** Копирует данные из ReadBuffer в WriteBuffer
|
||||
*/
|
||||
void copyData(ReadBuffer & from, WriteBuffer & to);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
16
dbms/src/IO/copyData.cpp
Normal file
16
dbms/src/IO/copyData.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include <DB/IO/copyData.h>
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user