[Vala] gio: how to read N bytes into a buffer at offset M?
- From: Matto Marjanovic <maddog mir com>
- To: vala-list gnome org
- Subject: [Vala] gio: how to read N bytes into a buffer at offset M?
- Date: Tue, 20 Dec 2011 00:39:45 -0800
Hi,
The subject line explains what I am trying to do. In plain old C,
I would simply use plain old libgio:
GInputStream* s = ...;
guint8 buffer[4096];
GError* error = NULL;
...
g_input_stream_read(s, buffer + M, N, NULL, &error);
How do I do this in Vala?
The 0.12 GIO bindings seemed to allow this, since read() and related methods
took a 'string' buffer parameter and a separate 'size_t' count parameter.
The 0.14 bindings, however, only all take a uint8[] parameter, and magically
derive the read size from the (full) array size. Is there some other magic
syntax I am supposed to use to access to the functionality of the underlying
C API?
-m
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]