buffer(integer:endianness:as:)

    Create a fresh ByteBuffer containing the bytes of the byte representation in the given endianness of integer.

    ByteBuffer-aux.swift:766
    func buffer<I>(integer: I, endianness: Endianness = .big, as: I.Type = I.self) -> ByteBuffer where I : FixedWidthInteger

    Returns

    The ByteBuffer containing the written bytes.

    This will allocate a new ByteBuffer with enough space to fit integer 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