RecvByteBufferAllocator
public protocol RecvByteBufferAllocator
Allocates ByteBuffer
s to be used to read bytes from a Channel
and records the number of the actual bytes that were used.
-
Allocates a new
ByteBuffer
that will be used to read bytes from aChannel
.Declaration
Swift
func buffer(allocator: ByteBufferAllocator) -> ByteBuffer
-
Records the actual number of bytes that were read by the last socket call.
Declaration
Swift
mutating func record(actualReadBytes: Int) -> Bool
Parameters
actualReadBytes
The number of bytes that were used by the previous allocated
ByteBuffer
Return Value
true
if the next call tobuffer
may return a bigger buffer then the last call tobuffer
.