bytes
The file’s contents, as an asynchronous sequence of bytes.
Declaration
var bytes: FileHandle.AsyncBytes { get }Discussion
Use the for-await-in syntax to iterate over the bytes in this sequence. For text files, you can also use its characters, unicodeScalars, or lines properties to retrieve the contents in a more convenient format. Since all of these properties conform to AsyncSequence, as does bytes itself, you can use methods defined by AsyncSequence to perform powerful inline processing. For example, you can skip the first n bytes of the file with myFileHandle.bytes.prefix(n).