︙ | | | ︙ | |
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
|
@throw [OFOutOfRangeException exception];
entry.versionMadeBy = (entry.versionMadeBy & 0xFF00) | 45;
entry.minVersionNeeded = (entry.minVersionNeeded & 0xFF00) | 45;
entry.compressedSize = 0;
entry.uncompressedSize = 0;
entry.CRC32 = 0;
entry.generalPurposeBitFlag |= (1 << 3) | (1 << 11);
entry.of_localFileHeaderOffset = _offset;
[_stream writeLittleEndianInt32: 0x04034B50];
[_stream writeLittleEndianInt16: entry.minVersionNeeded];
[_stream writeLittleEndianInt16: entry.generalPurposeBitFlag];
[_stream writeLittleEndianInt16: entry.compressionMethod];
[_stream writeLittleEndianInt16: entry.of_lastModifiedFileTime];
|
|
|
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
|
@throw [OFOutOfRangeException exception];
entry.versionMadeBy = (entry.versionMadeBy & 0xFF00) | 45;
entry.minVersionNeeded = (entry.minVersionNeeded & 0xFF00) | 45;
entry.compressedSize = 0;
entry.uncompressedSize = 0;
entry.CRC32 = 0;
entry.generalPurposeBitFlag |= (1u << 3) | (1u << 11);
entry.of_localFileHeaderOffset = _offset;
[_stream writeLittleEndianInt32: 0x04034B50];
[_stream writeLittleEndianInt16: entry.minVersionNeeded];
[_stream writeLittleEndianInt16: entry.generalPurposeBitFlag];
[_stream writeLittleEndianInt16: entry.compressionMethod];
[_stream writeLittleEndianInt16: entry.of_lastModifiedFileTime];
|
︙ | | | ︙ | |
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
|
_lastModifiedFileTime = [stream readLittleEndianInt16];
_lastModifiedFileDate = [stream readLittleEndianInt16];
_CRC32 = [stream readLittleEndianInt32];
_compressedSize = [stream readLittleEndianInt32];
_uncompressedSize = [stream readLittleEndianInt32];
fileNameLength = [stream readLittleEndianInt16];
extraFieldLength = [stream readLittleEndianInt16];
encoding = (_generalPurposeBitFlag & (1 << 11)
? OF_STRING_ENCODING_UTF_8
: OF_STRING_ENCODING_CODEPAGE_437);
_fileName = [[stream readStringWithLength: fileNameLength
encoding: encoding] copy];
if (extraFieldLength > 0)
extraField = [[[stream readDataWithCount:
|
|
|
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
|
_lastModifiedFileTime = [stream readLittleEndianInt16];
_lastModifiedFileDate = [stream readLittleEndianInt16];
_CRC32 = [stream readLittleEndianInt32];
_compressedSize = [stream readLittleEndianInt32];
_uncompressedSize = [stream readLittleEndianInt32];
fileNameLength = [stream readLittleEndianInt16];
extraFieldLength = [stream readLittleEndianInt16];
encoding = (_generalPurposeBitFlag & (1u << 11)
? OF_STRING_ENCODING_UTF_8
: OF_STRING_ENCODING_CODEPAGE_437);
_fileName = [[stream readStringWithLength: fileNameLength
encoding: encoding] copy];
if (extraFieldLength > 0)
extraField = [[[stream readDataWithCount:
|
︙ | | | ︙ | |
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
|
- (bool)matchesEntry: (OFZIPArchiveEntry *)entry
{
if (_compressionMethod != entry.compressionMethod ||
_lastModifiedFileTime != entry.of_lastModifiedFileTime ||
_lastModifiedFileDate != entry.of_lastModifiedFileDate)
return false;
if (!(_generalPurposeBitFlag & (1 << 3)))
if (_CRC32 != entry.CRC32 ||
_compressedSize != entry.compressedSize ||
_uncompressedSize != entry.uncompressedSize)
return false;
if (![_fileName isEqual: entry.fileName])
return false;
|
|
|
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
|
- (bool)matchesEntry: (OFZIPArchiveEntry *)entry
{
if (_compressionMethod != entry.compressionMethod ||
_lastModifiedFileTime != entry.of_lastModifiedFileTime ||
_lastModifiedFileDate != entry.of_lastModifiedFileDate)
return false;
if (!(_generalPurposeBitFlag & (1u << 3)))
if (_CRC32 != entry.CRC32 ||
_compressedSize != entry.compressedSize ||
_uncompressedSize != entry.uncompressedSize)
return false;
if (![_fileName isEqual: entry.fileName])
return false;
|
︙ | | | ︙ | |