dataWithContentsOfMappedFile
TypeScriptstatic dataWithContentsOfMappedFile(path: string): (unknown) | nullSwift declarationclass func dataWithContentsOfMappedFile(_ path: String) -> Any?class · SDK 27.1
class NSDatastatic dataWithContentsOfMappedFile(path: string): (unknown) | nullSwift declarationclass func dataWithContentsOfMappedFile(_ path: String) -> Any?base64EncodedData(options?: NSData_Base64EncodingOptions): ArrayBufferSwift declarationfunc base64EncodedData(options: NSData.Base64EncodingOptions = []) -> Database64EncodedString(options?: NSData_Base64EncodingOptions): stringSwift declarationfunc base64EncodedString(options: NSData.Base64EncodingOptions = []) -> Stringcompressed(algorithm: NSData_CompressionAlgorithm): NSDataSwift declarationfunc compressed(using algorithm: NSData.CompressionAlgorithm) throws -> Selfdecompressed(algorithm: NSData_CompressionAlgorithm): NSDataSwift declarationfunc decompressed(using algorithm: NSData.CompressionAlgorithm) throws -> SelfenumerateBytes(block: ((arg0: SDKHandle, arg1: SDKHandle, arg2: NativeOut<boolean>) => void)): voidSwift declarationfunc enumerateBytes(_ block: (UnsafeRawPointer, NSRange, UnsafeMutablePointer<ObjCBool>) -> Void)getBytes(buffer: SDKHandle): voidSwift declarationfunc getBytes(_ buffer: UnsafeMutableRawPointer)getBytesLength(buffer: SDKHandle, length: number): voidSwift declarationfunc getBytes(_ buffer: UnsafeMutableRawPointer, length: Int)getBytesRange(buffer: SDKHandle, range: SDKHandle): voidSwift declarationfunc getBytes(_ buffer: UnsafeMutableRawPointer, range: NSRange)static initBase64EncodedOptions(base64Data: ArrayBuffer, options?: NSData_Base64DecodingOptions): (NSData) | nullSwift declarationinit?(base64Encoded base64Data: Data, options: NSData.Base64DecodingOptions = [])static initBase64EncodedOptions17431(base64String: string, options?: NSData_Base64DecodingOptions): (NSData) | nullSwift declarationinit?(base64Encoded base64String: String, options: NSData.Base64DecodingOptions = [])static initBytesLength(bytes: (SDKHandle) | null, length: number): NSDataSwift declarationinit(bytes: UnsafeRawPointer?, length: Int)static initBytesNoCopyLength(bytes: SDKHandle, length: number): NSDataSwift declarationinit(bytesNoCopy bytes: UnsafeMutableRawPointer, length: Int)static initBytesNoCopyLengthDeallocator(bytes: SDKHandle, length: number, deallocator?: (((arg0: SDKHandle, arg1: number) => void)) | null): NSDataSwift declarationinit(bytesNoCopy bytes: UnsafeMutableRawPointer, length: Int, deallocator: ((UnsafeMutableRawPointer, Int) -> Void)? = nil)static initBytesNoCopyLengthFreeWhenDone(bytes: SDKHandle, length: number, b: boolean): NSDataSwift declarationinit(bytesNoCopy bytes: UnsafeMutableRawPointer, length: Int, freeWhenDone b: Bool)static initContentsOfFile(path: string): (NSData) | nullSwift declarationinit?(contentsOfFile path: String)static initContentsOfFileOptions(path: string, readOptionsMask?: NSData_ReadingOptions): NSDataSwift declarationinit(contentsOfFile path: String, options readOptionsMask: NSData.ReadingOptions = []) throwsstatic initContentsOfMappedFile(path: string): (NSData) | nullSwift declarationinit?(contentsOfMappedFile path: String)static initContentsOf(url: string): (NSData) | nullSwift declarationinit?(contentsOf url: URL)static initContentsOfOptions(url: string, readOptionsMask?: NSData_ReadingOptions): NSDataSwift declarationinit(contentsOf url: URL, options readOptionsMask: NSData.ReadingOptions = []) throwsstatic initData(data: ArrayBuffer): NSDataSwift declarationinit(data: Data)isEqual(other: ArrayBuffer): booleanSwift declarationfunc isEqual(to other: Data) -> Boolrange(dataToFind: ArrayBuffer, mask: NSData_SearchOptions, searchRange: SDKHandle): SDKHandleSwift declarationfunc range(of dataToFind: Data, options mask: NSData.SearchOptions = [], in searchRange: NSRange) -> NSRangesubdata(range: SDKHandle): ArrayBufferSwift declarationfunc subdata(with range: NSRange) -> DatawriteToFileAtomically(path: string, useAuxiliaryFile: boolean): booleanSwift declarationfunc write(toFile path: String, atomically useAuxiliaryFile: Bool) -> BoolwriteToFileOptions(path: string, writeOptionsMask?: NSData_WritingOptions): voidSwift declarationfunc write(toFile path: String, options writeOptionsMask: NSData.WritingOptions = []) throwswriteToAtomically(url: string, atomically: boolean): booleanSwift declarationfunc write(to url: URL, atomically: Bool) -> BoolwriteToOptions(url: string, writeOptionsMask?: NSData_WritingOptions): voidSwift declarationfunc write(to url: URL, options writeOptionsMask: NSData.WritingOptions = []) throwsget bytes(): SDKHandleSwift declarationvar bytes: UnsafeRawPointer { get }get description(): stringSwift declarationvar description: String { get }get length(): numberSwift declarationvar length: Int { get }firstRange(data: ArrayBuffer, r: SDKHandle): (SDKHandle) | nullSwift declaration@nonobjc func firstRange<D, R>(of data: D, in r: R) -> Range<Int>? where D : DataProtocol, R : RangeExpression, R.Bound == IntReturns the first found range of the given data buffer. A default implementation is given in terms of `self.regions`. - Parameters: - of: The data sequence to find. - in: A range to limit the scope of the search. - Returns: The range, if found, of the first match of the provided data sequence.
get startIndex(): numberSwift declaration@nonobjc var startIndex: Int { get }The position of the first element in a nonempty collection. If the collection is empty, `startIndex` is equal to `endIndex`.
get regions(): Array<ArrayBuffer>Swift declaration@nonobjc var regions: [Data] { get }A collection of buffers that make up the whole of the type conforming to a data protocol.
get endIndex(): numberSwift declaration@nonobjc var endIndex: Int { get }The collection's "past the end" position---that is, the position one greater than the last valid subscript argument. When you need a range that includes the last element of a collection, use the half-open range operator (`..<`) with `endIndex`. The `..<` operator creates a range that doesn't include the upper bound, so it's always safe to use with `endIndex`. For example: let numbers = [10, 20, 30, 40, 50] if let index = numbers.firstIndex(of: 30) { print(numbers[index ..< numbers.endIndex]) } // Prints "[30, 40, 50]" If the collection is empty, `endIndex` is equal to `startIndex`.
lastRange(data: ArrayBuffer, r: SDKHandle): (SDKHandle) | nullSwift declaration@nonobjc func lastRange<D, R>(of data: D, in r: R) -> Range<Int>? where D : DataProtocol, R : RangeExpression, R.Bound == IntReturns the last found range of the given data buffer. A default implementation is given in terms of `self.regions`. - Parameters: - of: The data sequence to find. - in: A range to limit the scope of the search. - Returns: The range, if found, of the last match of the provided data sequence.
subscript(position: number): numberSwift declaration@nonobjc subscript(position: Int) -> UInt8 { get }Accesses the element at the specified position. The following example accesses an element of an array through its subscript to print its value: var streets = ["Adams", "Bryant", "Channing", "Douglas", "Evarts"] print(streets[1]) // Prints "Bryant" You can subscript a collection with any valid index other than the collection's end index. The end index refers to the position one past the last element of a collection, so it doesn't correspond with an element. - Parameter position: The position of the element to access. `position` must be a valid index of the collection that is not equal to the `endIndex` property. - Complexity: O(1)
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
NSData.init()
inherited init: cannot prove legal (class declares 18 custom initializers)