(&mut self, buf: &mut [u8])
| 212 | .map_err(|_| io::Error::new(io::ErrorKind::InvalidData, "archive entry too large"))?; |
| 213 | let end = start |
| 214 | .checked_add(size) |
| 215 | .ok_or_else(|| io::Error::new(io::ErrorKind::InvalidData, "archive range overflow"))?; |
| 216 | if end > data_len { |
| 217 | return Err(io::Error::new( |
| 218 | io::ErrorKind::InvalidData, |
| 219 | "archive entry outside data bounds", |
| 220 | )); |
| 221 | } |
| 222 | Ok(start..end) |
| 223 | } |
| 224 | |
| 225 | /// Streaming file handle (for uncompressed files only) |
| 226 | pub struct PerroAssetsFile { |
| 227 | data: ArchiveBytes, |
| 228 | size: u64, |
| 229 | // Validated once at `stream_file`; reads index the cached range instead of |
no test coverage detected