MCPcopy Create free account
hub / github.com/cretz/stackparam / read_u16

Method read_u16

src/bytecode/io/reader.rs:923–933  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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)

Callers 11

read_constant_poolMethod · 0.80
read_constantMethod · 0.80
read_access_flagsMethod · 0.80
read_interfacesMethod · 0.80
read_fieldsMethod · 0.80
read_methodsMethod · 0.80
read_attributesMethod · 0.80
read_attributeMethod · 0.80
get_u16Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected