ReadableFileHandleProtocol

    A handle for reading data from an open file.

    FileHandleProtocol.swift:185ReadableFileHandleProtocol.md
    iOS
    13.0+
    macOS
    10.15+
    tvOS
    13.0+
    watchOS
    6.0+
    protocol ReadableFileHandleProtocol : FileHandleProtocol
    Browse conforming types

    ReadableFileHandleProtocol refines FileHandleProtocol to add requirements for reading data from a file.

    There are two requirements for implementing this protocol:

    1. readChunk(fromAbsoluteOffset:length:), and

    2. ``readChunks(chunkLength:)

    A number of overloads are provided which provide sensible defaults.

    Conformance to ReadableFileHandleProtocol also provides readToEnd(fromAbsoluteOffset:maximumSizeAllowed:) (and various overloads with sensible defaults) for reading the contents of a file into memory.

    Read the contents of a file

    Read part of a file

    Requirements

    Instance members

    See also