ObjFW  Diff

Differences From Artifact [6109b2512a]:

To Artifact [d48f1a83ef]:


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@interface OFZIPArchive_FileStream: OFStream
{
	OFStream *_stream, *_decompressedStream;
	OFZIPArchive_LocalFileHeader *_localFileHeader;
	bool _hasDataDescriptor;
	uint64_t _size;
	uint32_t _CRC32;
	bool _atEndOfStream;
}

-  initWithStream: (OFStream*)path
  localFileHeader: (OFZIPArchive_LocalFileHeader*)localFileHeader;
@end

uint32_t







|







71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@interface OFZIPArchive_FileStream: OFStream
{
	OFStream *_stream, *_decompressedStream;
	OFZIPArchive_LocalFileHeader *_localFileHeader;
	bool _hasDataDescriptor;
	uint64_t _size;
	uint32_t _CRC32;
	bool _atEndOfStream, _closed;
}

-  initWithStream: (OFStream*)path
  localFileHeader: (OFZIPArchive_LocalFileHeader*)localFileHeader;
@end

uint32_t
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
}

- (size_t)lowlevelReadIntoBuffer: (void*)buffer
			  length: (size_t)length
{
	size_t min, ret;

	if (_atEndOfStream)
		@throw [OFReadFailedException exceptionWithObject: self
						  requestedLength: length];

	if (_hasDataDescriptor) {
		if ([_decompressedStream isAtEndOfStream]) {
			uint32_t CRC32;








|







521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
}

- (size_t)lowlevelReadIntoBuffer: (void*)buffer
			  length: (size_t)length
{
	size_t min, ret;

	if (_atEndOfStream || _closed)
		@throw [OFReadFailedException exceptionWithObject: self
						  requestedLength: length];

	if (_hasDataDescriptor) {
		if ([_decompressedStream isAtEndOfStream]) {
			uint32_t CRC32;

571
572
573
574
575
576
577
578
579
580
	_CRC32 = crc32(_CRC32, buffer, ret);

	return ret;
}

- (void)close
{
	_atEndOfStream = true;
}
@end







|


571
572
573
574
575
576
577
578
579
580
	_CRC32 = crc32(_CRC32, buffer, ret);

	return ret;
}

- (void)close
{
	_closed = true;
}
@end