(&mut self)
| 921 | } |
| 922 | |
| 923 | pub fn read_u16(&mut self) -> Result<u16, Error> { |
| 924 | let mut buf: [u8; 2] = [0; 2]; |
| 925 | |
| 926 | match self.source.read_exact(&mut buf) { |
| 927 | Ok(_) => { |
| 928 | self.position += 2; |
| 929 | Ok(((buf[0] as u16) << 8) + buf[1] as u16) |
| 930 | }, |
| 931 | Err(err) => Err(err) |
| 932 | } |
| 933 | } |
| 934 | |
| 935 | pub fn get_u16(&mut self) -> u16 { |
| 936 | self.read_u16().unwrap_or(0) |
no outgoing calls
no test coverage detected