### Method

# FwupdPlugin Firmware write_chunk

#### 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` | `guint64`
| An address smaller than `fu_firmware_get_addr()`
`chunk_sz_max` | `guint64`
| The size of the new chunk.
`error` | `GError **`
| The return location for a `GError*`, or `NULL`.

#### Return value

Returns: | `GBytes`
| A `GBytes`, or `NULL`.
| The caller of the method takes ownership of the data, and is responsible for freeing it.