/// Reads the next 32-bit signed integer, advancing the cursor by four
/// bytes.
Reads the next 32-bit signed integer, advancing the cursor by four
bytes.
Reads the next 32 - bit signed integer advancing the cursor by four bytes .
pub(crate) fn read_i32(&mut self) -> Result<i32> {
        if self.buf.len() < 4 {
            return Err(Error::InvalidInput("not enough buffer to read 32bit Int".to_owned()));
        }
        let val = i32::from_be_bytes([self.buf[0], self.buf[1], self.buf[2], self.buf[3]]);
        self.advance(4);
        Ok(val)
    }
pub ( crate ) fn read_i32 ( & mut self ) -> Result < i32 > { if self . buf . len ( ) < 4 { return Err ( Error :: InvalidInput ( " " . to_owned ( ) ) ) ; } let val = i32 :: from_be_bytes ( [ self . buf [ 0 ] , self . buf [ 1 ] , self . buf [ 2 ] , self . buf [ 3 ] ] ) ; self . advance ( 4 ) ; Ok ( val ) }
Reads the next 32-bit signed integer, advancing the cursor by four
bytes.
Reads the next 32 - bit signed integer advancing the cursor by four bytes .
&mut self