Contents

read(into:startingAt:length:)

Synchronously reads data from the resource into a buffer.

Declaration

func read(into buffer: UnsafeMutableRawBufferPointer, startingAt offset: off_t, length: Int) throws -> Int

Parameters

  • buffer:

    A buffer to receive the data.

  • offset:

    The offset into the resource from which to start reading.

  • length:

    A maximum number of bytes to read. The method’s return value contains the actual number of bytes read.

Return Value

The actual number of bytes read.

Discussion

This is a synchronous version of read(into:startingAt:length:).

In some cases, this method performs a partial read. In this case, the return value is shorter than the requested length.

See Also

Reading and writing data