init(dispatchData:)

    Create a fresh ByteBuffer containing the bytes contained in the given DispatchData.

    ByteBuffer-aux.swift:688
    init(dispatchData: DispatchData)

    This will allocate a new ByteBuffer with enough space to fit the bytes of the DispatchData and potentially some extra space using the default allocator.

    • info: If you have access to a Channel, ChannelHandlerContext, or ByteBufferAllocator we recommend using channel.allocator.buffer(dispatchData:). Or if you want to write multiple items into the buffer use channel.allocator.buffer(capacity: ...) to allocate a ByteBuffer of the right size followed by a writeDispatchData instead of using this method. This allows SwiftNIO to do accounting and optimisations of resources acquired for operations on a given Channel in the future.

    Other members in extension

    Types

    Typealiases

    Show implementation details (2)

    Hide implementation details

    Type members

    Instance members

    Show obsolete interfaces (3)

    Hide obsolete interfaces