ByteArray

public struct ByteArray<T> where T : FixedWidthInteger, T : UnsignedInteger
extension ByteArray: Sequence
extension ByteArray: MutableCollection
extension ByteArray: BidirectionalCollection
extension ByteArray: RandomAccessCollection
extension ByteArray: RangeReplaceableCollection
extension ByteArray: Equatable
extension ByteArray: CustomStringConvertible
extension ByteArray: CustomDebugStringConvertible

Undocumented

  • Undocumented

    Declaration

    Swift

    fileprivate(set) public var rawValue: T { get }
  • Undocumented

    Declaration

    Swift

    public var capacity: Int { get }
  • Creates a new, empty array. All the elements are set to zero.

    Declaration

    Swift

    @inline(__always)
    public init()
  • Undocumented

    Declaration

    Swift

    @inline(__always)
    public init(rawValue: T)
  • Declaration

    Swift

    public typealias Iterator = ByteArrayIterator<T>
  • Declaration

    Swift

    public typealias Element = UInt8
  • Declaration

    Swift

    public func makeIterator() -> ByteArrayIterator<T>
  • Declaration

    Swift

    public typealias Index = Int
  • The position of the first element in a nonempty array. Always zero.

    Declaration

    Swift

    public var startIndex: Index { get }
  • The array’s “past the end” position—that is, the position one greater than the last valid subscript argument. This value is always equal to the bitWidth of the underlying storage.

    Declaration

    Swift

    public var endIndex: Index { get }
  • The number of elements in the array. This is fixed at the bitWidth of the underlying storage.

    Declaration

    Swift

    public var count: Int { get }
  • Replaces the given index with its successor.

    Declaration

    Swift

    public func index(after index: Index) -> Index
  • Accesses the element at the specified position.

    Precondition

    The index is in the valid range of startIndex upto but not includingendIndex.

    Declaration

    Swift

    public subscript(index: Index) -> Element { get set }

    Parameters

    index

    The position of the element to access. index must be greater than or equal to startIndex and less than endIndex.

    Return Value

    The bit value of the element.

  • Undocumented

    Declaration

    Swift

    public mutating func popFirst() -> Element?
  • Returns the position immediately before the given index.

    Declaration

    Swift

    public func index(before index: Index) -> Index
  • Undocumented

    Declaration

    Swift

    public mutating func popLast() -> Element?
  • Declaration

    Swift

    public typealias SubSequence = `Self`
  • Declaration

    Swift

    public init<S>(_ sequence: S) where S : Sequence, S.Element == ByteArray<T>.Element
  • Declaration

    Swift

    public init(repeating: Element, count: Int)
  • Declaration

    Swift

    public mutating func reserveCapacity(_ capacity: Int)
  • Declaration

    Swift

    public mutating func replaceSubrange<C>(_ subrange: Range<Index>, with newElements: C)
        where C: Collection, C.Element == Element
  • Declaration

    Swift

    public subscript(bounds: Range<Index>) -> ByteArray<T> { get set }
  • Declaration

    Swift

    public mutating func append(_ newElement: Element)
  • Declaration

    Swift

    public mutating func insert(_ newElement: Element, at index: Int)
  • Declaration

    Swift

    public mutating func insert<S>(contentsOf newElements: S, at idx: Index) where S : Collection, S.Element == UInt8
  • Undocumented

    Declaration

    Swift

    public mutating func removeAll()
  • Declaration

    Swift

    public mutating func removeAll(keepingCapacity keepCapacity: Bool)
  • Declaration

    Swift

    @discardableResult
    public mutating func removeFirst() -> UInt8
  • Declaration

    Swift

    public mutating func removeFirst(_ elements: Int)
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public mutating func removeLast() -> Element
  • Undocumented

    Declaration

    Swift

    public mutating func removeLast(_ elements: Int)
  • Declaration

    Swift

    @discardableResult
    public mutating func remove(at index: Int) -> Element
  • Declaration

    Swift

    public static func == (lhs: ByteArray<T>, rhs: ByteArray<T>) -> Bool
  • Declaration

    Swift

    public var description: String { get }
  • Declaration

    Swift

    public var debugDescription: String { get }