* garrow_mutable_buffer_new_bytes: * @data: Data for the buffer. * * Returns: A newly created #GArrowMutableBuffer. * * Since: 0.9.0 */
| 453 | * Since: 0.9.0 |
| 454 | */ |
| 455 | GArrowMutableBuffer * |
| 456 | garrow_mutable_buffer_new_bytes(GBytes *data) |
| 457 | { |
| 458 | size_t data_size; |
| 459 | auto raw_data = g_bytes_get_data(data, &data_size); |
| 460 | auto mutable_raw_data = const_cast<gpointer>(raw_data); |
| 461 | auto arrow_buffer = |
| 462 | std::make_shared<arrow::MutableBuffer>(static_cast<uint8_t *>(mutable_raw_data), |
| 463 | data_size); |
| 464 | return garrow_mutable_buffer_new_raw_bytes(&arrow_buffer, data); |
| 465 | } |
| 466 | |
| 467 | /** |
| 468 | * garrow_mutable_buffer_slice: |
nothing calls this directly
no test coverage detected