Add clear method to byte_stream

This commit is contained in:
Lee Clagett 2020-08-17 16:20:09 -04:00
parent 765db1ae7a
commit b641e0a2c0
2 changed files with 44 additions and 0 deletions

View file

@ -117,6 +117,9 @@ namespace epee
check(more);
}
//! Reset write position, but do not release internal memory. \post `size() == 0`.
void clear() noexcept { next_write_ = buffer_.get(); }
/*! Copy `length` bytes starting at `ptr` to end of stream.
\throw std::range_error If exceeding max size_t value.
\throw std::bad_alloc If allocation fails. */