/// Read bytes if the remaining data is prefixed by the provided tag
Read bytes if the remaining data is prefixed by the provided tag
Read bytes if the remaining data is prefixed by the provided tag
pub(crate) fn read_optional_tag(&mut self, tag: &[u8]) -> Result<bool, io::Error> {
        if self.remaining.starts_with(tag) {
            self.read_exact(tag.len())?;
            Ok(true)
        } else {
            Ok(false)
        }
    }
pub ( crate ) fn read_optional_tag ( & mut self , tag : & [ u8 ] ) -> Result < bool , io :: Error > { if self . remaining . starts_with ( tag ) { self . read_exact ( tag . len ( ) ) ? ; Ok ( true ) } else { Ok ( false ) } }
Read bytes if the remaining data is prefixed by the provided tag
Read bytes if the remaining data is prefixed by the provided tag
&mut self
tag
&[u8]