2017-06-29 12:59:47 -05:00
|
|
|
use byteorder::{BigEndian, ByteOrder};
|
|
|
|
|
2017-01-24 10:55:42 -06:00
|
|
|
fn main() {
|
2017-06-29 12:59:47 -05:00
|
|
|
let buf = &[1,2,3,4];
|
|
|
|
let n = <BigEndian as ByteOrder>::read_u32(buf);
|
|
|
|
assert_eq!(n, 0x01020304);
|
2018-08-02 03:45:08 -05:00
|
|
|
println!("{:#010x}", n);
|
2018-07-26 09:43:45 -05:00
|
|
|
eprintln!("standard error");
|
2017-01-24 10:55:42 -06:00
|
|
|
}
|