ReadFilePart

public struct ReadFilePart : Codable, Equatable, TDFunction

Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the client has no direct access to TDLib’s file system, because it is usually slower than a direct read from the file

  • Undocumented

    Declaration

    Swift

    public typealias Result = FilePart
  • Identifier of the file. The file must be located in the TDLib file cache

    Declaration

    Swift

    public let fileId: Int32
  • The offset from which to read the file

    Declaration

    Swift

    public let offset: Int32
  • Number of bytes to read. An error will be returned if there are not enough bytes available in the file from the specified position. Pass 0 to read all available data from the specified position

    Declaration

    Swift

    public let count: Int32
  • Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the client has no direct access to TDLib’s file system, because it is usually slower than a direct read from the file

    Declaration

    Swift

    public init(fileId: Int32, offset: Int32, count: Int32)

    Parameters

    fileId

    Identifier of the file. The file must be located in the TDLib file cache

    offset

    The offset from which to read the file

    count

    Number of bytes to read. An error will be returned if there are not enough bytes available in the file from the specified position. Pass 0 to read all available data from the specified position