RecvByteBufferAllocator

public protocol RecvByteBufferAllocator

Allocates ByteBuffers 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 a Channel.

    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 to buffer may return a bigger buffer then the last call to buffer.