Protocol
DataProtocol
iOS 8.0+
iPadOS 8.0+
Mac Catalyst 8.0+
macOS 10.10+
tvOS 9.0+
watchOS 2.0+
A protocol that provides consistent data access to the bytes underlying contiguous and noncontiguous data buffers.
protocol DataProtocol : RandomAccessCollection where Self.Element == UInt8, Self.SubSequence : DataProtocol
Topics
Associated Types
associatedtype Regions : BidirectionalCollectionA type that represents a collection of contiguous parts that make up the type conforming to a data protocol.
Instance Properties
var regions: Self.RegionsA collection of buffers that make up the whole of the type conforming to a data protocol.
Instance Methods
func copyBytes(to:)Copies the bytes of data from the type into a raw memory buffer.func copyBytes(to:count:)Copiescountbytes from the start of the buffer to the destination buffer.func copyBytes(to:from:)Copies the bytes from the given range to the destination buffer.func firstRange<D>(of: D) -> Range<Self.Index>?Returns the first found range of the type’s data buffer.func firstRange<D, R>(of: D, in: R) -> Range<Self.Index>?Returns the first found range of the given data buffer.func lastRange<D>(of: D) -> Range<Self.Index>?Returns the last found range of the type’s data buffer.func lastRange<D, R>(of: D, in: R) -> Range<Self.Index>?Returns the last found range of the given data buffer.
Relationships
Inherits From
Swift.BidirectionalCollectionSwift.CollectionSwift.RandomAccessCollectionSwift.Sequence