Lines Matching refs:pos
15 pos: usize, field
21 return Self { data: data, pos: 0 }; in new()
28 pos: 0, in zerod()
46 if self.pos >= self.data.len() { in read_u8()
49 self.pos += 1; in read_u8()
50 return Ok(self.data[self.pos - 1]); in read_u8()
55 if self.pos + 2 > self.data.len() { in read_u16()
59 res |= (self.data[self.pos] as u16) & 0xff; in read_u16()
60 self.pos += 1; in read_u16()
61 res |= ((self.data[self.pos] as u16) & 0xff) << 8; in read_u16()
62 self.pos += 1; in read_u16()
69 if self.pos + 4 > self.data.len() { in read_u32()
74 res |= ((self.data[self.pos] as u32) & 0xff) << (8 * i); in read_u32()
75 self.pos += 1; in read_u32()
83 if self.pos + 8 > self.data.len() { in read_u64()
88 res |= ((self.data[self.pos] as u64) & 0xff) << (8 * i); in read_u64()
89 self.pos += 1; in read_u64()
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()
114 if self.pos + buf.len() * size_of::<u16>() > self.data.len() * size_of::<u16>() { in read_u16_into()
132 let pos: i64; in seek() localVariable
135 pos = offset; in seek()
138 pos = self.pos as i64 + offset; in seek()
142 pos = self.data.len() as i64 + offset; in seek()
149 if pos < 0 || pos > self.data.len() as i64 { in seek()
152 self.pos = pos as usize; in seek()
153 return Ok(self.pos); in seek()
158 if self.pos >= self.data.len() { in write_u8()
162 self.data[self.pos] = value; in write_u8()
163 self.pos += 1; in write_u8()
170 if self.pos + 2 > self.data.len() { in write_u16()
174 self.data[self.pos] = (value & 0xff) as u8; in write_u16()
175 self.pos += 1; in write_u16()
176 self.data[self.pos] = ((value >> 8) & 0xff) as u8; in write_u16()
177 self.pos += 1; in write_u16()
184 if self.pos + 4 > self.data.len() { in write_u32()
189 self.data[self.pos] = ((value >> (i * 8)) & 0xff) as u8; in write_u32()
190 self.pos += 1; in write_u32()
198 if self.pos + 8 > self.data.len() { in write_u64()
203 self.data[self.pos] = ((value >> (i * 8)) & 0xff) as u8; in write_u64()
204 self.pos += 1; in write_u64()
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()
239 pub fn pos(&self) -> usize { in pos() method
240 return self.pos; in pos()