Lines Matching refs:buf
102 pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), SystemError> { in read_exact()
103 if self.pos + buf.len() > self.data.len() { in read_exact()
106 buf.copy_from_slice(&self.data[self.pos..self.pos + buf.len()]); in read_exact()
107 self.pos += buf.len(); in read_exact()
114 pub fn read_u16_into(&mut self, buf: &mut [u16]) -> Result<(), SystemError> { in read_u16_into()
115 if self.pos + size_of_val(buf) > self.data.len() * size_of::<u16>() { in read_u16_into()
119 for item in buf.iter_mut() { in read_u16_into()
210 pub fn write_exact(&mut self, buf: &[u8]) -> Result<(), SystemError> { in write_exact()
211 if self.pos + buf.len() > self.data.len() { in write_exact()
215 self.data[self.pos..self.pos + buf.len()].copy_from_slice(buf); in write_exact()
216 self.pos += buf.len(); in write_exact()