19 using namespace impala;
30 zlong |=
static_cast<uint64_t>(**buf & 0x7f) << shift;
32 more = (**buf & 0x80) != 0;
35 return (zlong >> 1) ^ -(zlong & 1);
40 uint32_t uinteger = (integer << 1) ^ (integer >> 31);
41 const int mask = 0x7f;
42 const int cont = 0x80;
43 buf[0] = uinteger & mask;
45 while ((uinteger >>= 7) != 0) {
48 buf[len] = uinteger & mask;
57 uint64_t ulongint = (longint << 1) ^ (longint >> 63);
58 const int mask = 0x7f;
59 const int cont = 0x80;
60 buf[0] = ulongint & mask;
62 while ((ulongint >>= 7) != 0) {
65 buf[len] = ulongint & mask;
75 for (
int i = 0; i < length; ++i) {
76 ss << static_cast<int>(buf[i]) <<
" ";
82 return HexDump(reinterpret_cast<const uint8_t*>(buf), length);
static int PutZInt(int32_t integer, uint8_t *buf)
Put a zigzag encoded integer into a buffer and return its length.
static int64_t ReadZLong(uint8_t **buf)
static std::string HexDump(const uint8_t *buf, int64_t length)
Dump the first length bytes of buf to a Hex string.
static int PutZLong(int64_t longint, uint8_t *buf)
Put a zigzag encoded long integer into a buffer and return its length.