Data

struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessCollection, MutableCollection, RangeReplaceableCollection
  • Convenience function to read a range of Data and deserialize it into the specified type.

    Declaration

    Swift

    public func extract<T>(start: Int, length: Int) throws -> T

    Parameters

    start

    The starting position of the range to read.

    length

    The number of bytes to read from start.

  • Allows using Data as is when using Bluejay and working with write-related operations.

    Declaration

    Swift

    public func toBluetoothData() -> Data
  • Allows using Data as is when using Bluejay and working with read-related operations.

    Declaration

    Swift

    public init(bluetoothData: Data)