Instance Methodswift-nio 2.72.0NIOCore->Swift
setOrWriteBuffer(_:)
If nil
, replace self
with .some(buffer)
. If non-nil
, write buffer
’s readable bytes into the ByteBuffer
starting at writerIndex
.
@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
func setOrWriteImmutableBuffer(ByteBuffer
) -> Int If
nil
, replaceself
with.some(buffer)
. If non-nil
, writebuffer
’s readable bytes into theByteBuffer
starting atwriterIndex
.