MCPcopy Create free account
hub / github.com/apache/arrow / garrow_buffer_copy

Function garrow_buffer_copy

c_glib/arrow-glib/buffer.cpp:384–394  ·  view source on GitHub ↗

* garrow_buffer_copy: * @buffer: A #GArrowBuffer. * @start: An offset of data to be copied in byte. * @size: The number of bytes to be copied from the start. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable) (transfer full): * A newly copied #GArrowBuffer on success, %NULL on error. * * Since: 0.3.0 */

Source from the content-addressed store, hash-verified

382 * Since: 0.3.0
383 */
384GArrowBuffer *
385garrow_buffer_copy(GArrowBuffer *buffer, gint64 start, gint64 size, GError **error)
386{
387 auto arrow_buffer = garrow_buffer_get_raw(buffer);
388 auto maybe_copied_buffer = arrow_buffer->CopySlice(start, size);
389 if (garrow::check(error, maybe_copied_buffer, "[buffer][copy]")) {
390 return garrow_buffer_new_raw(&(*maybe_copied_buffer));
391 } else {
392 return NULL;
393 }
394}
395
396/**
397 * garrow_buffer_slice:

Callers

nothing calls this directly

Calls 3

garrow_buffer_get_rawFunction · 0.85
CopySliceMethod · 0.80
checkFunction · 0.70

Tested by

no test coverage detected