load_bytes


Description:

[ Version ( since = "2.56" ) ]
public Bytes load_bytes (Cancellable? cancellable = null, out string? etag_out = null) throws Error

Loads the contents of this and returns it as Bytes.

If this is a resource:// based URI, the resulting bytes will reference the embedded resource instead of a copy. Otherwise, this is equivalent to calling load_contents and Bytes.take.

For resources, etag_out will be set to null.

The data contained in the resulting Bytes is always zero-terminated, but this is not included in the Bytes length. The resulting Bytes should be freed with g_bytes_unref when no longer in use.

Parameters:

this

a File

cancellable

a Cancellable or null

etag_out

a location to place the current entity tag for the file, or null if the entity tag is not needed

Returns:

a Bytes or null and throws is set




2022 vala-language.org