| 222 | } |
| 223 | |
| 224 | void readbuf(uint size = BUFSIZE) |
| 225 | { |
| 226 | if(!zfile.avail_in) zfile.next_in = (Bytef *)buf; |
| 227 | size = min(size, uint(&buf[BUFSIZE] - &zfile.next_in[zfile.avail_in])); |
| 228 | if(arch->owner != this) |
| 229 | { |
| 230 | arch->owner = NULL; |
| 231 | if(arch->data->seek(reading, SEEK_SET)) arch->owner = this; |
| 232 | else return; |
| 233 | } |
| 234 | uint remaining = info->offset + info->compressedsize - reading; |
| 235 | int n = arch->owner == this ? (int)arch->data->read(zfile.next_in + zfile.avail_in, min(size, remaining)) : 0; |
| 236 | zfile.avail_in += n; |
| 237 | reading += n; |
| 238 | } |
| 239 | |
| 240 | bool open(ziparchive *a, zipfile *zf) |
| 241 | { |