setOrWriteBuffer(_:)

    If nil, replace self with .some(buffer). If non-nil, write buffer’s readable bytes into the ByteBuffer starting at writerIndex.

    ByteBuffer-aux.swift:846
    @discardableResult mutating func setOrWriteBuffer(_ buffer: inout ByteBuffer) -> Int

    Parameters

    buffer

    The ByteBuffer to write.

    Returns

    The number of bytes written to this ByteBuffer which is equal to the number of bytes read from buffer.

    This will move both this ByteBuffer’s writer index as well as buffer’s reader index by the number of bytes readable in buffer.

    Other members in extension

    Instance members