mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 05:22:17 +00:00
Added util var_uint.
This commit is contained in:
parent
e00a97496f
commit
614f49533e
24
dbms/src/IO/tests/var_uint.cpp
Normal file
24
dbms/src/IO/tests/var_uint.cpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <DB/IO/VarInt.h>
|
||||||
|
#include <Poco/NumberParser.h>
|
||||||
|
#include <Poco/HexBinaryEncoder.h>
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char ** argv)
|
||||||
|
{
|
||||||
|
if (argc != 2)
|
||||||
|
{
|
||||||
|
std::cerr << "Usage: " << std::endl
|
||||||
|
<< argv[0] << " unsigned_number" << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
DB::UInt64 x = Poco::NumberParser::parseUnsigned64(argv[1]);
|
||||||
|
Poco::HexBinaryEncoder hex(std::cout);
|
||||||
|
DB::writeVarUInt(x, hex);
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user