Type Definition byteorder::NetworkEndian [] [src]

type NetworkEndian = BigEndian;

Defines network byte order serialization.

Network byte order is defined by RFC 1700 to be big-endian, and is referred to in several protocol specifications. This type is an alias of BigEndian.

Note that this type has no value constructor. It is used purely at the type level.


Write and read i16 numbers in big endian order:

use byteorder::{ByteOrder, NetworkEndian, BigEndian};

let mut buf = [0; 2];
BigEndian::write_i16(&mut buf, -50_000);
assert_eq!(-50_000, NetworkEndian::read_i16(&buf));