ContiguousBytes

public extension ContiguousBytes

This was inspired by this SO answer

These casts are relatively safe, as the returned Arrays will not include any of the remainder memory, in unaligned streams.

This means that the last memory may not be included in casts.

  • The stream, as an Array of standard Int

    Declaration

    Swift

    var asIntArray: [Int] { get }
  • The stream, as an Array of unsigned byte

    Declaration

    Swift

    var asUInt8Array: [UInt8] { get }
  • The stream, as an Array of unsigned word

    Declaration

    Swift

    var asUInt16Array: [UInt16] { get }
  • The stream, as an Array of unsigned long word

    Declaration

    Swift

    var asUInt32Array: [UInt32] { get }
  • The stream, as an Array of unsigned long long word

    Declaration

    Swift

    var asUInt64Array: [UInt64] { get }