* garrow_readable_read: * @readable: A #GArrowReadable. * @n_bytes: The number of bytes to be read. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (transfer full) (nullable): #GArrowBuffer that has read * data on success, %NULL if there was an error. */
| 52 | * data on success, %NULL if there was an error. |
| 53 | */ |
| 54 | GArrowBuffer * |
| 55 | garrow_readable_read(GArrowReadable *readable, gint64 n_bytes, GError **error) |
| 56 | { |
| 57 | const auto arrow_readable = garrow_readable_get_raw(readable); |
| 58 | |
| 59 | auto arrow_buffer = arrow_readable->Read(n_bytes); |
| 60 | if (garrow::check(error, arrow_buffer, "[readable][read]")) { |
| 61 | auto *iface = GARROW_READABLE_GET_IFACE(readable); |
| 62 | return iface->buffer_new_raw(&(arrow_buffer.ValueOrDie())); |
| 63 | } else { |
| 64 | return NULL; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * garrow_readable_read_bytes: |
nothing calls this directly
no test coverage detected