41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
@interface OFLHAArchive_FileReadStream: OFStream <OFReadyForReadingObserving>
{
OF_KINDOF(OFStream *) _stream;
OF_KINDOF(OFStream *) _decompressedStream;
OFLHAArchiveEntry *_entry;
uint32_t _toRead, _bytesConsumed;
uint16_t _CRC16;
bool _atEndOfStream;
}
- (instancetype)of_initWithStream: (OF_KINDOF(OFStream *))stream
entry: (OFLHAArchiveEntry *)entry;
- (void)of_skip;
@end
|
|
|
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
@interface OFLHAArchive_FileReadStream: OFStream <OFReadyForReadingObserving>
{
OF_KINDOF(OFStream *) _stream;
OF_KINDOF(OFStream *) _decompressedStream;
OFLHAArchiveEntry *_entry;
uint32_t _toRead, _bytesConsumed;
uint16_t _CRC16;
bool _atEndOfStream, _skipped;
}
- (instancetype)of_initWithStream: (OF_KINDOF(OFStream *))stream
entry: (OFLHAArchiveEntry *)entry;
- (void)of_skip;
@end
|
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
|
}
- (void)of_skip
{
OF_KINDOF(OFStream *) stream;
uint32_t toRead;
if (_stream == nil || _toRead == 0)
return;
stream = _stream;
toRead = _toRead;
/*
* Get the number of consumed bytes and directly read from the
|
|
|
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
|
}
- (void)of_skip
{
OF_KINDOF(OFStream *) stream;
uint32_t toRead;
if (_stream == nil || _skipped)
return;
stream = _stream;
toRead = _toRead;
/*
* Get the number of consumed bytes and directly read from the
|
405
406
407
408
409
410
411
412
413
414
415
416
417
418
|
toRead -= [stream readIntoBuffer: buffer
length: min];
}
}
_toRead = 0;
}
- (void)close
{
[self of_skip];
[_stream release];
|
>
|
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
|
toRead -= [stream readIntoBuffer: buffer
length: min];
}
}
_toRead = 0;
_skipped = true;
}
- (void)close
{
[self of_skip];
[_stream release];
|