### Method

# GLib IOChannel read_chars

#### Declaration

    GIOStatus
    g_io_channel_read_chars (
      GIOChannel* channel,
      gchar* buf,
      gsize count,
      gsize* bytes_read,
      GError** error
    )

#### Description

Replacement for `g_io_channel_read()` with the new API.

#### Parameters

`buf`

  Type: An array of `guint8`

      a buffer to read data into.

  The argument will be set by the function.
  The length of the array is specified in the `count` argument.
  The data is owned by the instance.

`count`

  Type: `gsize`

  The size of the buffer. Note that the buffer may not be completely filled even if there is data in the buffer if the remaining data is not a complete character.

`bytes_read`

  Type: `gsize*`

  The number of bytes read. This may be zero even on success if count < 6 and the channel’s encoding is non-`NULL`. This indicates that the next UTF-8 character is too wide for the buffer.

  The argument will be set by the function.
  The argument can be `NULL`.

`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 be 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: `GIOStatus`

The status of the operation.