DecodeData
public struct DecodeData
Decoder
Provides easy methods for Decoding values out of a Data Stream
-
Current Index
The index into the data the decoder is at
Declaration
Swift
private(set) public var index: Int
-
Undocumented
Declaration
Swift
public init(startIndex: Int = 0)
-
Decodes Raw data from data Stream
Declaration
Swift
mutating func decodeData(_ data: Data, length: Int) -> Data
Parameters
data
Data stream
length
Length of Data to pull out of stream
Return Value
Data Instance
-
Decodes Raw data from data Stream only if Present
Declaration
Swift
mutating func decodeDataIfPresent(_ data: Data, length: Int) -> Data?
Parameters
data
Data stream
length
Length of Data to pull out of stream
Return Value
Data Instance
-
Decodes Nibble from the data stream
Declaration
Swift
mutating func decodeNibble(_ data: Data) -> Nibble
Parameters
data
Data stream
Return Value
Nibble Instance
-
Decodes Nibble from the data stream only if present
Declaration
Swift
mutating func decodeNibbleIfPresent(_ data: Data) -> Nibble?
Parameters
data
Data stream
Return Value
Nibble value
-
Decodes Int8 from the data stream
Declaration
Swift
mutating func decodeInt8(_ data: Data) -> Int8
Parameters
data
Data stream
Return Value
Int8 value
-
Decodes Int8 from the data stream only if present
Declaration
Swift
mutating func decodeInt8IfPresent(_ data: Data) -> Int8?
Parameters
data
Data stream
Return Value
UInt8 value
-
Decodes UInt8 from the data stream
Declaration
Swift
mutating func decodeUInt8(_ data: Data) -> UInt8
Parameters
data
Data stream
Return Value
UInt8 value
-
Decodes UInt8 from the data stream only if present
Declaration
Swift
mutating func decodeUInt8IfPresent(_ data: Data) -> UInt8?
Parameters
data
Data stream
Return Value
UInt8 value
-
Decodes Int16 from the data stream
Declaration
Swift
mutating func decodeInt16(_ data: Data) -> Int16
Parameters
data
Data stream
Return Value
Int16 value
-
Decodes Int16 from the data stream only if present
Declaration
Swift
mutating func decodeInt16IfPresent(_ data: Data) -> Int16?
Parameters
data
Data stream
Return Value
Int16 value
-
Deocdes UInt16 from the data stream
Declaration
Swift
mutating func decodeUInt16(_ data: Data) -> UInt16
Parameters
data
Data stream
Return Value
UInt16 value
-
Decodes UInt16 from the data stream only if present
Declaration
Swift
mutating func decodeUInt16IfPresent(_ data: Data) -> UInt16?
Parameters
data
Data stream
Return Value
UInt16 value
-
Decodes UInt24 from the data stream
Declaration
Swift
mutating func decodeUInt24(_ data: Data) -> Int
Parameters
data
Data stream
Return Value
Int value
-
Decodes Int24 from the data stream
Declaration
Swift
mutating func decodeInt24(_ data: Data) -> Int
Parameters
data
Data stream
Return Value
Int value
-
Decodes Int32 from the data stream
Declaration
Swift
mutating func decodeInt32(_ data: Data) -> Int32
Parameters
data
Data stream
Return Value
Int32 value
-
Decodes Int32 from the data stream only if present
Declaration
Swift
mutating func decodeInt32IfPresent(_ data: Data) -> Int32?
Parameters
data
Data stream
Return Value
Int32 value
-
Decodes UInt32 from the data stream
Declaration
Swift
mutating func decodeUInt32(_ data: Data) -> UInt32
Parameters
data
Data stream
Return Value
UInt32 value
-
Decodes UInt32 from the data stream only if present
Declaration
Swift
mutating func decodeUInt32IfPresent(_ data: Data) -> UInt32?
Parameters
data
Data stream
Return Value
UInt32 value
-
Decodes UInt48 from the data stream
Declaration
Swift
mutating func decodeUInt48(_ data: Data) -> UInt
Parameters
data
Data stream
Return Value
UInt value
-
Deocdes Int64 from the data stream
Declaration
Swift
mutating func decodeInt64(_ data: Data) -> Int64
Parameters
data
Data stream
Return Value
Int64 value
-
Decodes Int64 from the data stream only if present
Declaration
Swift
mutating func decodeInt64IfPresent(_ data: Data) -> Int64?
Parameters
data
Data stream
Return Value
Int64 value
-
Decodes UInt64 from the data stream
Declaration
Swift
mutating func decodeUInt64(_ data: Data) -> UInt64
Parameters
data
Data stream
Return Value
UInt64 value
-
Decodes UInt64 from the data stream only if present
Declaration
Swift
mutating func decodeUInt64IfPresent(_ data: Data) -> UInt64?
Parameters
data
Data stream
Return Value
UInt64 value
-
Decodes IP Address from the data stream
Declaration
Swift
mutating func decodeIPAddress(_ data: Data, fromLittleEndian: Bool = false) -> String
Parameters
data
Data stream
fromLittleEndian
If IP Address is encoded as Little Endian
Return Value
String Representation of the IP Address
-
Decodes MAC Address from the data stream
Declaration
Swift
mutating func decodeMACAddress(_ data: Data, fromLittleEndian: Bool = false) -> MACAddress
Parameters
data
Data stream
fromLittleEndian
If MAC is encoded as Little Endian
Return Value
String Representation of the MAC Address
-
Decodes ANT Toggle Byte from the data stream
Declaration
Swift
mutating func decodeANTToggleByte(_ data: Data) -> ANTToggleByte
Parameters
data
Data stream
Return Value
ANTToggleByte Instance
-
Decodes IEEE-754 Float32 from the data stream
Declaration
Swift
mutating func decodeFloat32(_ data: Data) -> Float32
Parameters
data
Data stream
Return Value
Float32 Value
-
Decodes IEEE-754 Float32 from the data stream if present
Declaration
Swift
mutating func decodeFloat32IfPresent(_ data: Data) -> Float32?
Parameters
data
Data stream
Return Value
Float32 Value
-
Decodes IEEE-754 Float64 from the data stream
Declaration
Swift
mutating func decodeFloat64(_ data: Data) -> Float64
Parameters
data
Data stream
Return Value
Float64 Value
-
Decodes IEEE-754 Float64 from the data stream if present
Declaration
Swift
mutating func decodeFloat64IfPresent(_ data: Data) -> Float64?
Parameters
data
Data stream
Return Value
Float64 Value
-
Decodes IEEE-11073 16-bit SFLOAT from the data stream
Declaration
Swift
mutating func decodeSFloatValue(_ data: Data) -> Float
Parameters
data
Data stream
Return Value
Float value
-
Decodes IEEE-11073 16-bit SFLOAT from the data stream only if Present
Declaration
Swift
mutating func decodeSFloatValueIfPresent(_ data: Data) -> Float?
Parameters
data
Data stream
Return Value
Float value
-
Decodes IEEE-11073 32-bit FLOAT from the data stream
Declaration
Swift
mutating func decodeFloatValue(_ data: Data) -> Float
Parameters
data
Data stream
Return Value
Float value
-
Decodes IEEE-11073 32-bit FLOAT from the data stream
Declaration
Swift
mutating func decodeFloatValueifPresent(_ data: Data) -> Float?
Parameters
data
Data stream
Return Value
Float value