| 30 | namespace fory { |
| 31 | |
| 32 | OutputStream::OutputStream(uint32_t buffer_size) |
| 33 | : buffer_(std::make_unique<Buffer>()) { |
| 34 | const uint32_t actual_size = std::max<uint32_t>(buffer_size, 1U); |
| 35 | buffer_->reserve(actual_size); |
| 36 | buffer_->writer_index(0); |
| 37 | buffer_->reader_index(0); |
| 38 | buffer_->bind_output_stream(this); |
| 39 | active_buffer_ = buffer_.get(); |
| 40 | } |
| 41 | |
| 42 | OutputStream::~OutputStream() { |
| 43 | if (active_buffer_ != nullptr && active_buffer_ != buffer_.get()) { |
nothing calls this directly
no test coverage detected