FwupdPlugin.Firmware.write_chunk

### Method

# FwupdPlugin Firmwarewrite_chunk

since: 1.6.0

#### Declaration [src]

    GBytes*
    fu_firmware_write_chunk (
      FuFirmware* self,
      guint64 address,
      guint64 chunk_sz_max,
      GError** error
    )

#### Description [src]

Gets a block of data from the image. If the contents of the image is smaller than the requested chunk size then the `GBytes` will be smaller than `chunk_sz_max`. Use `fu_bytes_pad()` if padding is required.

If the `address` is larger than the size of the image then an error is returned.

Available since: 1.6.0

#### Parameters

`address`

  Type: `guint64`

  An address smaller than `fu_firmware_get_addr()`

`chunk_sz_max`

  Type: `guint64`

  The size of the new chunk.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `GBytes`

A `GBytes`, or `NULL`.

The caller of the method takes ownership of the data, and is responsible for freeing it.