pub fn parse_two_byte_int<R: io::Read>(reader: &mut R) -> Result<Self, Error> {
    let mut buffer = [0; 2];
    reader.read_exact(&mut buffer)?;
    Ok(Self::TwoByteInteger(u16::from_be_bytes(buffer)))
  }
/// Reads two bytes from the reader and attempts to convert the bytes to DataType::TwoByteInteger (u16).
///
/// [1.5.2 Two Byte Integer](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901008)
///
/// Two Byte Integer data values are 16-bit unsigned integers in big-endian
/// order: the high order byte precedes the lower order byte. This means that a
/// 16-bit word is presented on the network as Most Significant Byte (MSB),
/// followed by Least Significant Byte (LSB).
///
/// # Examples
///
/// ```rust
/// use mqtt_packet::DataType;
/// use std::io;
///
/// let data: Vec<u8> = vec![0x01, 0x02, 0x03];
/// let mut reader = io::BufReader::new(&data[..]);
/// let two = DataType::parse_two_byte_int(&mut reader).unwrap();
/// assert_eq!(two, DataType::TwoByteInteger(258));
/// ```
Reads two bytes from the reader and attempts to convert the bytes to DataType::TwoByteInteger (u16).

Two Byte Integer data values are 16-bit unsigned integers in big-endian
order: the high order byte precedes the lower order byte. This means that a
16-bit word is presented on the network as Most Significant Byte (MSB),
followed by Least Significant Byte (LSB).
Reads two bytes from the reader and attempts to convert the bytes to DataType :: TwoByteInteger ( u16 ) . Two Byte Integer data values are 16 - bit unsigned integers in big - endian order : the high order byte precedes the lower order byte . This means that a 16 - bit word is presented on the network as Most Significant Byte ( MSB ) followed by Least Significant Byte ( LSB ) .
pub fn parse_two_byte_int<R: io::Read>(reader: &mut R) -> Result<Self, Error> {
    let mut buffer = [0; 2];
    reader.read_exact(&mut buffer)?;
    Ok(Self::TwoByteInteger(u16::from_be_bytes(buffer)))
  }
pub fn parse_two_byte_int < R : io :: Read > ( reader : & mut R ) -> Result < Self , Error > { let mut buffer = [ 0 ; 2 ] ; reader . read_exact ( & mut buffer ) ? ; Ok ( Self :: TwoByteInteger ( u16 :: from_be_bytes ( buffer ) ) ) }
Reads two bytes from the reader and attempts to convert the bytes to DataType::TwoByteInteger (u16).
Reads two bytes from the reader and attempts to convert the bytes to DataType :: TwoByteInteger ( u16 ) .
reader
&mut R
reader
&mut R
examples
```rust
use mqtt_packet::DataType;
use std::io.

let data: Vec = vec![0x01, 0x02, 0x03];
let mut reader = io::BufReader::new(&data[..]);
let two = DataType::parse_two_byte_int(&mut reader).unwrap();
assert_eq!(two, DataType::TwoByteInteger(258));
```
` ` ` rust use mqtt_packet :: DataType ; use std :: io . let data : Vec = vec! [ 0x01 0x02 0x03 ] ; let mut reader = io :: BufReader :: new ( &data [ .. ] ) ; let two = DataType :: parse_two_byte_int ( &mut reader ) . unwrap () ; assert_eq! ( two DataType :: TwoByteInteger ( 258 )) ; ` ` `