Contents

read(length:from:completionHandler:)

Reads bytes from a byte source into a data object.

Declaration

func read(length: Int, from offset: Int64, completionHandler: @escaping  @Sendable (Data?, (any Error)?) -> Void)
func read(length: Int, from offset: Int64) async throws -> Data

Parameters

  • length:

    The number of bytes to read.

  • offset:

    The relative offset in bytes from the beginning of the file from which to start reading.

  • completionHandler:

    The completion block to execute when the read operation finishes.

See Also

Performing operations on a byte source