ManagedByteBuffer

public protocol ManagedByteBuffer
  • The total length of the buffer in bytes.

    Declaration

    Swift

    var length: Int { get }
  • This is an index that can be used to indicate the number valid bytes in the buffer starting at the beginning of the buffer. The methods in this protocol will all assume that count is used for that purpose and will be updated accordingly.

    Declaration

    Swift

    var count: Int { get set }
  • Declaration

    Swift

    @discardableResult
    func withBufferAs<T, V>(type: T.Type, _ body: (UnsafeBufferPointer<T>, inout Int) throws -> V) rethrows -> V
  • Declaration

    Swift

    @discardableResult
    func withBufferAs<T, V>(type: T.Type, _ body: (UnsafePointer<T>, inout Int) throws -> V) rethrows -> V
  • Declaration

    Swift

    @discardableResult
    func withBytes<V>(_ body: (UnsafePointer<UInt8>, inout Int) throws -> V) rethrows -> V
  • Declaration

    Swift

    @discardableResult
    func withBytes<V>(_ body: (UnsafeBufferPointer<UInt8>, inout Int) throws -> V) rethrows -> V