17 const char* description) {
25 if (integer > 0xFF) bytes = 2;
26 if (integer > 0xFFFF) bytes = 3;
27 if (integer > 0xFFFFFF) bytes = 4;
28 integer |= (bytes - 1);
29 Put(
static_cast<uint8_t
>(integer & 0xFF),
"IntPart1");
30 if (bytes > 1)
Put(
static_cast<uint8_t
>((integer >> 8) & 0xFF),
"IntPart2");
31 if (bytes > 2)
Put(
static_cast<uint8_t
>((integer >> 16) & 0xFF),
"IntPart3");
32 if (bytes > 3)
Put(
static_cast<uint8_t
>((integer >> 24) & 0xFF),
"IntPart4");
36 const char* description) {
37#ifdef MEMORY_SANITIZER
38 __msan_check_mem_is_initialized(data, number_of_bytes);
40 data_.insert(
data_.end(), data, data + number_of_bytes);
44 data_.insert(
data_.end(), other.data_.begin(), other.data_.end());
void PutN(int number_of_bytes, const uint8_t v, const char *description)
void Append(const SnapshotByteSink &other)
void PutUint30(uint32_t integer, const char *description)
void PutRaw(const uint8_t *data, int number_of_bytes, const char *description)
void Put(uint8_t b, const char *description)
std::vector< uint8_t > data_
int GetBlob(const uint8_t **data)
#define CHECK_LT(lhs, rhs)
#define CHECK_LE(lhs, rhs)