encode

fnubyte[T.sizeof] encode(T)(T value, ByteOrder order) if (isWireScalar!T) @safe pure nothrow @nogc

Encodes one scalar of type T as T.sizeof bytes in byte order order — the one-off form of the writer's put.

Parameters

valuethe value to encode.
orderthe byte order.

Returns

the encoded bytes in a fixed-size array.