OutputStream
Object Hierarchy:
Description:
public abstract class OutputStream :
Object
OutputStream has functions to write to a stream (
write), to close a stream (
close) and to flush pending writes (
flush).
To copy the content of an input stream to an output stream without manually handling the reads and writes, use
splice.
All of these functions have async variants too.
Content:
Creation methods:
Methods:
- public void clear_pending ()
Clears the pending flag on this.
- public abstract bool close (Cancellable? cancellable = null) throws IOError
Closes the stream, releasing resources related to it.
- public virtual async bool close_async (int io_priority = DEFAULT, Cancellable? cancellable = null) throws IOError
Requests an asynchronous close of the stream, releasing resources
related to it.
- public virtual bool flush (Cancellable? cancellable = null) throws Error
Forces a write of all user-space buffered data for the given
this.
- public virtual async bool flush_async (int io_priority = DEFAULT, Cancellable? cancellable = null) throws Error
Forces an asynchronous write of all user-space buffered data for
the given this.
- public bool has_pending ()
Checks if an ouput stream has pending actions.
- public bool is_closed ()
Checks if an output stream has already been closed.
- public bool is_closing ()
Checks if an output stream is being closed.
- public bool set_pending () throws Error
Sets this to have actions
pending.
- public virtual ssize_t splice (InputStream source, OutputStreamSpliceFlags flags, Cancellable? cancellable = null) throws IOError
Splices an input stream into an output stream.
- public virtual async ssize_t splice_async (InputStream source, OutputStreamSpliceFlags flags, int io_priority = DEFAULT, Cancellable? cancellable = null) throws IOError
Splices a stream asynchronously.
- public abstract ssize_t write (uint8[] buffer, Cancellable? cancellable = null) throws IOError
Tries to write buffer.length
bytes from buffer
into the stream.
- public bool write_all (uint8[] buffer, out size_t bytes_written, Cancellable? cancellable = null) throws IOError
Tries to write buffer.length
bytes from buffer
into the stream.
- public async bool write_all_async (uint8[] buffer, int io_priority, Cancellable? cancellable, out size_t bytes_written) throws Error
- public virtual async ssize_t write_async (uint8[] buffer, int io_priority = DEFAULT, Cancellable? cancellable = null) throws IOError
Request an asynchronous write of buffer.length
bytes
from buffer
into the stream.
- public ssize_t write_bytes (Bytes bytes, Cancellable? cancellable = null) throws Error
A wrapper function for
write which takes a
Bytes as input.
- public async ssize_t write_bytes_async (Bytes bytes, int io_priority = DEFAULT, Cancellable? cancellable = null) throws Error
Inherited Members:
All known members inherited from class GLib.Object