buffer(integer:endianness:as:)

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

ByteBuffer-aux.swift:815
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.