diff options
Diffstat (limited to 'src/stream.cc')
-rw-r--r-- | src/stream.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/stream.cc b/src/stream.cc index bb9b7a3b..a127e706 100644 --- a/src/stream.cc +++ b/src/stream.cc @@ -154,6 +154,13 @@ std::unique_ptr<OutputBuffer> MemoryStream::ReleaseOutputBuffer() { return std::move(buf_); } +void MemoryStream::Clear() { + if (buf_) + buf_->clear(); + else + buf_.reset(new OutputBuffer()); +} + Result MemoryStream::WriteDataImpl(size_t dst_offset, const void* src, size_t size) { |