[Vala] Is it possible to do a reading buffer offset in vala?



Hi all 

I have a little problem on working with buffer offsets in vala.
In C doing an offset for a "char buf[SOME_SIZE];" is easy, but I have
difficulties doing it in vala.

I attach a testcase with gio async file reading to this mail. In this
testcase there is no buffer offset, so the chunks of the file read are
always put to the beginning of the buffer, overwriting themselves. I
will only get the last chunk that was read from the file.
In the testcase I use a "char[] buffer;".

So how can I do an offset for a reading (and/or writing) buffer in vala?
Any hints appreciated!
Regards 
Jörn

PS: I am not interested in a read_line_async workaround as I have more
cases where a buffer is needed.

Attachment: buffertest.vala
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]