Function as_u16

Source
pub fn as_u16(buf: &[u8]) -> u16
Expand description

slice as u16.

ยงUnit Test

let int = faster_stun::util::as_u16(&[0x00, 0x04]);
assert_eq!(int, 4);