### Virtual Method

# Vips Source read

#### Declaration [src]

    gint64
    read (
      VipsSource* source,
      void* buffer,
      size_t length
    )

#### Description [src]

Read up to `length` bytes from `source` and store the bytes in `buffer`. Return the number of bytes actually read. If all bytes have been read from the file, return 0.

Arguments exactly as `read()`.

#### Parameters

`buffer`

  Type: `void*`

  Store bytes here.

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

`length`

  Type: `size_t`

  Length of `buffer` in bytes.

#### Return value

Type: `gint64`

The number of bytes read, 0 on end of file, -1 on error.