* garrow_buffer_slice: * @buffer: A #GArrowBuffer. * @offset: An offset in the buffer data in byte. * @size: The number of bytes of the sliced data. * * Returns: (transfer full): A newly created #GArrowBuffer that shares * data of the base #GArrowBuffer. The created #GArrowBuffer has data * start with offset from the base buffer data and are the specified * bytes size. * * Since: 0
| 407 | * Since: 0.3.0 |
| 408 | */ |
| 409 | GArrowBuffer * |
| 410 | garrow_buffer_slice(GArrowBuffer *buffer, gint64 offset, gint64 size) |
| 411 | { |
| 412 | auto arrow_parent_buffer = garrow_buffer_get_raw(buffer); |
| 413 | auto arrow_buffer = std::make_shared<arrow::Buffer>(arrow_parent_buffer, offset, size); |
| 414 | return garrow_buffer_new_raw_parent(&arrow_buffer, buffer); |
| 415 | } |
| 416 | |
| 417 | G_DEFINE_TYPE(GArrowMutableBuffer, garrow_mutable_buffer, GARROW_TYPE_BUFFER) |
| 418 |
nothing calls this directly
no test coverage detected