Instance Method (Default implementation)swift-nio 2.72.0_NIOFileSystem
readChunks(in:chunkLength:)
Returns an asynchronous sequence of chunks read from the file.
FileHandleProtocol.swift:249- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
func readChunks(in range: PartialRangeFrom<Int64>, chunkLength: ByteCount = .kibibytes(128)) -> FileChunks
Parameters
- range
A range of offsets in the file to read.
- chunkLength
The length of chunks to read, defaults to 128 KiB.
- as
Type of chunk to read.
Returns
An AsyncSequence
of chunks read from the file.
Implements
func readChunks(in: Range<Int64>, chunkLength: ByteCount
) -> FileChunks Returns an asynchronous sequence of chunks read from the file.
See also
func bufferedReader(startingAtAbsoluteOffset: Int64, capacity: ByteCount
) -> BufferedReader<Self> Creates a new
BufferedReader
for this file handle.func readChunks(chunkLength: ByteCount
) -> FileChunks Returns an asynchronous sequence of chunks read from the file.
func readChunks(in: Range<Int64>, chunkLength: ByteCount
) -> FileChunks Returns an asynchronous sequence of chunks read from the file.
func readChunks(in: UnboundedRange, chunkLength: ByteCount
) -> FileChunks Returns an asynchronous sequence of chunks read from the file.
func readChunks(in: ClosedRange<Int64>, chunkLength: ByteCount
) -> FileChunks Returns an asynchronous sequence of chunks read from the file.
func readChunks(in: PartialRangeThrough<Int64>, chunkLength: ByteCount
) -> FileChunks Returns an asynchronous sequence of chunks read from the file.
func readChunks(in: PartialRangeUpTo<Int64>, chunkLength: ByteCount
) -> FileChunks Returns an asynchronous sequence of chunks read from the file.
func readToEnd(fromAbsoluteOffset: Int64, maximumSizeAllowed: ByteCount
) async throws -> ByteBuffer Returns the contents of a file by loading it into memory.