Address4.toBytes

Produces a byte array containing this address in network byte order.

struct Address4
const @nogc nothrow pure @safe
ubyte[4]
toBytes
()

Return Value

Type: ubyte[4]

This address as raw bytes in network byte order.

Examples

const actual = address4("192.168.0.1");
const ubyte[4] expected = [192, 168, 0, 1];
assert(actual.get.toBytes() == expected);

Meta