DirectZ
Loading...
Searching...
No Matches
vlen.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace vlen {
4 inline void write_u64(std::ostream& out, uint64_t value, size_t& wrote_bytes) {
5 out.write((const char*)&value, sizeof(value));
6 wrote_bytes += sizeof(value);
7 }
8
9 inline bool read_u64(std::istream& in, uint64_t& result, size_t& read_bytes) {
10 if (!in.good()) return false;
11 result = 0;
12 in.read((char*)&result, sizeof(result));
13 read_bytes += sizeof(result);
14 return true;
15 }
16}
Definition vlen.hpp:3
bool read_u64(std::istream &in, uint64_t &result, size_t &read_bytes)
Definition vlen.hpp:9
void write_u64(std::ostream &out, uint64_t value, size_t &wrote_bytes)
Definition vlen.hpp:4