buffer(data:)

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

    ByteBuffer-foundation.swift:372
    func buffer(data: Data) -> ByteBuffer

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