### Method

# Gio File load_bytes_async

since: 2.56

#### Declaration

    void
    g_file_load_bytes_async (
      GFile* file,
      GCancellable* cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data
    )

#### Description

Asynchronously loads the contents of `file` as `GBytes`.

If `file` is a resource:// based URI, the resulting bytes will reference the embedded resource instead of a copy. Otherwise, this is equivalent to calling `g_file_load_contents_async()` and g_bytes_new_take().

`callback` should call `g_file_load_bytes_finish()` to get the result of this asynchronous operation.

See `g_file_load_bytes()` for more information.

Available since: 2.56

#### Parameters

`cancellable`

  Type: `GCancellable`

  A `GCancellable` or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`callback`

  Type: `GAsyncReadyCallback`

  A `GAsyncReadyCallback` to call when the request is satisfied.

  The argument can be `NULL`.

`user_data`

  Type: `gpointer`

  The data to pass to callback function.

  The argument can be `NULL`.
  The data is owned by the caller of the method.