GObject.Object
Gio.InputStream
Import line: | Gio = imports.gi.Gio; |
GIR File: | Gio-2.0.gir |
C documentation: | GInputStream |
Class : | InputStream |
Subclasses: | Gio.BufferedInputStream, Gio.ConverterInputStream, Gio.DataInputStream, Gio.FileInputStream, Gio.FilterInputStream |
Extends: | GObject.Object |
Properties | Defined By | |
---|---|---|
parent_instance : GObject.Object
read only
|
Gio.InputStream | |
priv : Gio.InputStreamPrivate
read only
|
Gio.InputStream |
Method / Constructor | Defined By | |
---|---|---|
new Gio.InputStream
(Object properties)
Create a new Gio.InputStream
Create a new Gio.InputStream
|
||
clear_pending
()
:
none
Clears the pending flag on stream.
Clears the pending flag on stream.
|
Gio.InputStream | |
close
(Cancellable cancellable)
:
gboolean
Closes the stream, releasing resources related to it.
Closes the stream, releasing resources related to it.
Once the stream is closed, all other operations will return G_IO_ERROR_CLOSED. Closing a stream multiple times will not return an error. Streams will be automatically closed when the last reference is dropped, but you might want to call this function to make sure resources are released as early as possible. Some streams might keep the backing store of the stream (e.g. a file descriptor) open after the stream is closed. See the documentation for the individual stream for details. On failure the first error that happened will be reported, but the close operation will finish as much as possible. A stream that failed to close will still return G_IO_ERROR_CLOSED for all operations. Still, it is important to check and report the error to the user. If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. Cancelling a close will still leave the stream closed, but some streams can use a faster close that doesn't block to e.g. check errors.
|
Gio.InputStream | |
close_async
(gint32 io_priority, Cancellable cancellable, Function callback, void* user_data)
:
none
Requests an asynchronous closes of the stream, releasing resources related to it.
Requests an asynchronous closes of the stream, releasing resources related to it.
When the operation is finished callback will be called. You can then call g_input_stream_close_finish() to get the result of the operation. For behaviour details see g_input_stream_close(). The asyncronous methods have a default fallback that uses threads to implement asynchronicity, so they are optional for inheriting classes. However, if you override one you must override all.
|
Gio.InputStream | |
close_finish
(AsyncResult result)
:
gboolean
Finishes closing a stream asynchronously, started from g_input_stream_close_async().
Finishes closing a stream asynchronously, started from g_input_stream_close_async().
|
Gio.InputStream | |
has_pending
()
:
gboolean
Checks if an input stream has pending actions.
Checks if an input stream has pending actions.
|
Gio.InputStream | |
is_closed
()
:
gboolean
Checks if an input stream is closed.
Checks if an input stream is closed.
|
Gio.InputStream | |
Tries to read count bytes from the stream into the buffer starting at
If count is zero returns zero and does nothing.
Tries to read count bytes from the stream into the buffer starting at
If count is zero returns zero and does nothing. A value of count larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error. On success, the number of bytes read into the buffer is returned. It is not an error if this is not the same as the requested size, as it can happen e.g. near the end of a file. Zero is returned on end of file (or if count is zero), but never otherwise. If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error. On error -1 is returned and error is set accordingly.
|
Gio.InputStream | |
Tries to read count bytes from the stream into the buffer starting at
This function is similar to g_input_stream_read(), except it tries to read as many bytes as requested, only stopping on an error or end of stream.
Tries to read count bytes from the stream into the buffer starting at
This function is similar to g_input_stream_read(), except it tries to read as many bytes as requested, only stopping on an error or end of stream. On a successful read of count bytes, or if we reached the end of the stream, TRUE is returned, and bytes_read is set to the number of bytes read into buffer. If there is an error during the operation FALSE is returned and error is set to indicate the error status, bytes_read is updated to contain the number of bytes read into buffer before the error occurred.
|
Gio.InputStream | |
read_async
(void* buffer, guint32 count, gint32 io_priority, Cancellable cancellable, Function callback, void* user_data)
:
none
Request an asynchronous read of count bytes from the stream into the buffer
starting at buffer.
Request an asynchronous read of count bytes from the stream into the buffer
starting at buffer. When the operation is finished callback will be called. You can then call g_input_stream_read_finish() to get the result of the operation. During an async request no other sync and async calls are allowed on stream, and will result in G_IO_ERROR_PENDING errors. A value of count larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error. On success, the number of bytes read into the buffer will be passed to the callback. It is not an error if this is not the same as the requested size, as it can happen e.g. near the end of a file, but generally we try to read as many bytes as requested. Zero is returned on end of file (or if count is zero), but never otherwise. Any outstanding i/o request with higher priority (lower numerical value) will be executed before an outstanding request with lower priority. Default priority is G_PRIORITY_DEFAULT. The asyncronous methods have a default fallback that uses threads to implement asynchronicity, so they are optional for inheriting classes. However, if you override one you must override all.
|
Gio.InputStream | |
read_finish
(AsyncResult result)
:
gint32
Finishes an asynchronous stream read operation.
Finishes an asynchronous stream read operation.
|
Gio.InputStream | |
set_pending
()
:
gboolean
Sets stream to have actions pending.
Sets stream to have actions pending. If the pending flag is
already set or stream is closed, it will return FALSE and set
|
Gio.InputStream | |
Tries to skip count bytes from the stream.
Tries to skip count bytes from the stream. Will block during the operation.
This is identical to g_input_stream_read(), from a behaviour standpoint, but the bytes that are skipped are not returned to the user. Some streams have an implementation that is more efficient than reading the data. This function is optional for inherited classes, as the default implementation emulates it using read. If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error.
|
Gio.InputStream | |
skip_async
(guint32 count, gint32 io_priority, Cancellable cancellable, Function callback, void* user_data)
:
none
Request an asynchronous skip of count bytes from the stream.
Request an asynchronous skip of count bytes from the stream.
When the operation is finished callback will be called. You can then call g_input_stream_skip_finish() to get the result of the operation. During an async request no other sync and async calls are allowed, and will result in G_IO_ERROR_PENDING errors. A value of count larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error. On success, the number of bytes skipped will be passed to the callback. It is not an error if this is not the same as the requested size, as it can happen e.g. near the end of a file, but generally we try to skip as many bytes as requested. Zero is returned on end of file (or if count is zero), but never otherwise. Any outstanding i/o request with higher priority (lower numerical value) will be executed before an outstanding request with lower priority. Default priority is G_PRIORITY_DEFAULT. The asynchronous methods have a default fallback that uses threads to implement asynchronicity, so they are optional for inheriting classes. However, if you override one, you must override all.
|
Gio.InputStream | |
skip_finish
(AsyncResult result)
:
gint32
Finishes a stream skip operation.
Finishes a stream skip operation.
|
Gio.InputStream |
None |
Class / Namespace | Method / Signal / Properties |
---|---|
GdkPixbuf.Pixbuf
Method |
Create a new GdkPixbuf.Pixbuf
|
GdkPixbuf.Pixbuf
Method |
new GdkPixbuf.Pixbuf.from_stream_at_scale
(InputStream stream, gint32 width, gint32 height, gboolean preserve_aspect_ratio, Cancellable cancellable)
:
GdkPixbuf.Pixbuf
Create a new GdkPixbuf.Pixbuf
|
GdkPixbuf.Pixbuf
Method |
GdkPixbuf.Pixbuf.new_from_stream_async
(InputStream stream, Cancellable cancellable, Function callback, void* user_data)
:
none
Creates a new pixbuf by asynchronously loading an image from an input stream.
|
GdkPixbuf.Pixbuf
Method |
GdkPixbuf.Pixbuf.new_from_stream_at_scale_async
(InputStream stream, gint32 width, gint32 height, gboolean preserve_aspect_ratio, Cancellable cancellable, Function callback, void* user_data)
:
none
Creates a new pixbuf by asynchronously loading an image from an input stream.
|
Gio.BufferedInputStream
Method |
Create a new Gio.BufferedInputStream
|
Gio.BufferedInputStream
Method |
Create a new Gio.BufferedInputStream
|
Gio.ConverterInputStream
Method |
Create a new Gio.ConverterInputStream
|
Gio.DataInputStream
Method |
Create a new Gio.DataInputStream
|
Gio.FilterInputStream
Property |
base_stream : Gio.InputStream
|
Gio.FilterInputStream
Method |
get_base_stream
()
:
Gio.InputStream
Gets the base stream for the filter stream.
|
Gio.IOStream
Property |
input_stream : Gio.InputStream
read only
|
Gio.IOStream
Method |
get_input_stream
()
:
Gio.InputStream
Gets the input stream for this object.
|
Gio.LoadableIcon
Method |
Loads a loadable icon.
|
Gio.LoadableIcon
Method |
Finishes an asynchronous icon load started in g_loadable_icon_load_async().
|
Gio.OutputStream
Method |
Splices an input stream into an output stream.
|
Gio.OutputStream
Method |
splice_async
(InputStream source, OutputStreamSpliceFlags flags, gint32 io_priority, Cancellable cancellable, Function callback, void* user_data)
:
none
Splices a stream asynchronously.
|
Json.Parser
Method |
|
Json.Parser
Method |
load_from_stream_async
(InputStream stream, Cancellable cancellable, Function callback, void* user_data)
:
none
|