gio: add GBytes-based input/output stream methods

Using a caller-supplied buffer for g_input_stream_read() doesn't
translate well to the semantics of many other languages, and using a
non-refcounted buffer for read_async() and write_async() makes it
impossible to manage the memory correctly currently in
garbage-collected languages.

Fix both of these issues by adding a new set of methods that work with
GBytes objects rather than plain buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=671139
This commit is contained in:
Dan Winship
2012-04-05 09:19:17 -04:00
committed by Jasper St. Pierre
parent 4b456635e4
commit 800d6ff111
8 changed files with 428 additions and 0 deletions

View File

@@ -562,6 +562,9 @@ g_input_stream_is_closed
g_input_stream_has_pending
g_input_stream_set_pending
g_input_stream_clear_pending
g_input_stream_read_bytes
g_input_stream_read_bytes_async
g_input_stream_read_bytes_finish
<SUBSECTION Standard>
GInputStreamClass
G_INPUT_STREAM
@@ -769,6 +772,9 @@ g_output_stream_is_closed
g_output_stream_has_pending
g_output_stream_set_pending
g_output_stream_clear_pending
g_output_stream_write_bytes
g_ouuput_stream_write_bytes_async
g_output_stream_write_bytes_finish
<SUBSECTION Standard>
GOutputStreamClass
G_OUTPUT_STREAM