* Write a single byte into the dumper. * @param b The byte to write. */
| 153 | * @param b The byte to write. |
| 154 | */ |
| 155 | inline void WriteByte(uint8_t b) |
| 156 | { |
| 157 | /* Are we at the end of this chunk? */ |
| 158 | if (this->buf == this->bufe) { |
| 159 | this->buf = this->blocks.emplace_back(std::make_unique<uint8_t[]>(MEMORY_CHUNK_SIZE)).get(); |
| 160 | this->bufe = this->buf + MEMORY_CHUNK_SIZE; |
| 161 | } |
| 162 | |
| 163 | *this->buf++ = b; |
| 164 | } |
| 165 | |
| 166 | /** |
| 167 | * Flush this dumper into a writer. |