Lines Matching refs:buf
101 pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), SystemError> { in read_exact()
102 if self.pos + buf.len() > self.data.len() { in read_exact()
105 buf.copy_from_slice(&self.data[self.pos..self.pos + buf.len()]); in read_exact()
106 self.pos += buf.len(); in read_exact()
113 pub fn read_u16_into(&mut self, buf: &mut [u16]) -> Result<(), SystemError> { in read_u16_into()
114 if self.pos + buf.len() * size_of::<u16>() > self.data.len() * size_of::<u16>() { in read_u16_into()
118 for i in 0..buf.len() { in read_u16_into()
119 buf[i] = self.read_u16()?; in read_u16_into()
216 pub fn write_exact(&mut self, buf: &[u8]) -> Result<(), SystemError> { in write_exact()
217 if self.pos + buf.len() > self.data.len() { in write_exact()
221 self.data[self.pos..self.pos + buf.len()].copy_from_slice(&buf[..]); in write_exact()
222 self.pos += buf.len(); in write_exact()