Instance Methodswift-nio 2.72.0_NIOFileSystem
read(_:)
Read at most count
bytes from the file; reads short if not enough bytes are available.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
mutating func read(_ count: ByteCount) async throws -> ByteBuffer
Parameters
- count
The number of bytes to read.
Returns
The bytes read from the buffer.
Other members in extension
Instance members
let capacity: Int
The capacity of the buffer.
var count: Int
The number of bytes currently in the buffer.
func drop(Int
) async throws Reads and discards the given number of bytes.
func drop(while: (UInt8) -> Bool
) async throws Reads and discards bytes until
predicate
returnsfalse.
func read(while: (UInt8) -> Bool
) async throws -> (bytes: ByteBuffer, readEOF: Bool) Reads from the current position in the file until
predicate
returnsfalse
and returns the read bytes.