pub fn unwrap_endian_u16(header: &parser::ElfHeader,
                         reader: &mut std::io::Cursor<Vec<u8>>)
                         -> u16 {
    match header.endianness {
        parser::Endianness::Big => reader.read_u16::<BigEndian>().unwrap(),
        parser::Endianness::Little => reader.read_u16::<LittleEndian>().unwrap(),
        _ => panic!("Failed because endianness could not be determined"),
    }
}
/*
 * Convert a byte vector, wrapped in a `Cursor', to a `u16'. The vector must
 * have a length of 2, otherwise this functions panics. The endianness is
 * determined based on the endian field of the passed-in `header' struct.
 * Similar functions for `u32' and `u64' conversion exists, too.
 */
Convert a byte vector, wrapped in a `Cursor', to a `u16'. The vector must
have a length of 2, otherwise this functions panics. The endianness is
determined based on the endian field of the passed-in `header' struct.
Similar functions for `u32' and `u64' conversion exists, too.
Convert a byte vector wrapped in a ` Cursor ' to a ` u16 ' . The vector must have a length of 2 otherwise this functions panics . The endianness is determined based on the endian field of the passed - in ` header ' struct . Similar functions for ` u32 ' and ` u64 ' conversion exists too .
pub fn unwrap_endian_u16(header: &parser::ElfHeader,
                         reader: &mut std::io::Cursor<Vec<u8>>)
                         -> u16 {
    match header.endianness {
        parser::Endianness::Big => reader.read_u16::<BigEndian>().unwrap(),
        parser::Endianness::Little => reader.read_u16::<LittleEndian>().unwrap(),
        _ => panic!("Failed because endianness could not be determined"),
    }
}
pub fn unwrap_endian_u16 ( header : & parser :: ElfHeader , reader : & mut std :: io :: Cursor < Vec < u8 > > ) -> u16 { match header . endianness { parser :: Endianness :: Big => reader . read_u16 :: < BigEndian > ( ) . unwrap ( ) , parser :: Endianness :: Little => reader . read_u16 :: < LittleEndian > ( ) . unwrap ( ) , _ => panic ! ( " " ) , } }
Convert a byte vector, wrapped in a `Cursor', to a `u16'.
Convert a byte vector wrapped in a ` Cursor ' to a ` u16 ' .
header
&parser::ElfHeader
reader
&mut std::io::Cursor<Vec<u8>>