buffer(staticString:)

    Create a fresh ByteBuffer containing the bytes of the string encoded as UTF-8.

    ByteBuffer-aux.swift:741
    func buffer(staticString string: StaticString) -> ByteBuffer

    Returns

    The ByteBuffer containing the written bytes.

    This will allocate a new ByteBuffer with enough space to fit string and potentially some extra space.

    Other members in extension

    Type members

    • init()

      Create a fresh ByteBufferAllocator. In the future the allocator might use for example allocation pools and therefore it’s recommended to reuse ByteBufferAllocators where possible instead of creating fresh ones in many places.

    Instance members