| 52 | mutable_data_(buffer->mutable_data()) {} |
| 53 | |
| 54 | Result<std::shared_ptr<BufferOutputStream>> BufferOutputStream::Create( |
| 55 | int64_t initial_capacity, MemoryPool* pool) { |
| 56 | // ctor is private, so cannot use make_shared |
| 57 | auto ptr = std::shared_ptr<BufferOutputStream>(new BufferOutputStream); |
| 58 | RETURN_NOT_OK(ptr->Reset(initial_capacity, pool)); |
| 59 | return ptr; |
| 60 | } |
| 61 | |
| 62 | Status BufferOutputStream::Reset(int64_t initial_capacity, MemoryPool* pool) { |
| 63 | ARROW_ASSIGN_OR_RAISE(buffer_, AllocateResizableBuffer(initial_capacity, pool)); |