Instance Method

readLength(_:completionHandler:)

Read a certain number of bytes on a connection

Declaration

func readLength(_ length: Int, completionHandler completion: @escaping (Data?, Error?) -> Void)

Parameters

length

The exact number of bytes the caller wants to read.

completionHandler

The completion handler to be invoked when data has been read or an error occurred.

Discussion

Read length number of bytes. See readMinimumLength:maximumLength:completionHandler: for a complete discussion of the callback behavior.

See Also

Transferring Data

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software