Differences From Artifact [1983c233dd]:
- File
src/OFZIPArchiveEntry.m
— part of check-in
[8ebf6ed443]
at
2017-08-13 22:34:33
on branch trunk
— OFZIPArchive(Entry): Remove ZIP64 from extra field
Treating the ZIP64 extra field as part of the entry itself makes things
a lot easier when (re)writing the central directory. (user: js, size: 12236) [annotate] [blame] [check-ins using]
To Artifact [fef61c95a7]:
- File src/OFZIPArchiveEntry.m — part of check-in [def4cbbba6] at 2017-08-14 00:31:05 on branch trunk — OFZIPArchive: Support for writing ZIP64 archives (user: js, size: 12462) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
420 421 422 423 424 425 426 | objc_autoreleasePoolPop(pool); return [ret autorelease]; } - (uint64_t)of_writeToStream: (OFStream *)stream { | | | < < < < | | | | | > > > > > > > > > > > > < < | | 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | objc_autoreleasePoolPop(pool); return [ret autorelease]; } - (uint64_t)of_writeToStream: (OFStream *)stream { void *pool = objc_autoreleasePoolPush(); uint64_t size = 0; if (UINT16_MAX - [_extraField count] < 32) @throw [OFOutOfRangeException exception]; [stream writeLittleEndianInt32: 0x02014B50]; [stream writeLittleEndianInt16: _versionMadeBy]; [stream writeLittleEndianInt16: _minVersionNeeded]; [stream writeLittleEndianInt16: _generalPurposeBitFlag]; [stream writeLittleEndianInt16: _compressionMethod]; [stream writeLittleEndianInt16: _lastModifiedFileTime]; [stream writeLittleEndianInt16: _lastModifiedFileDate]; [stream writeLittleEndianInt32: _CRC32]; [stream writeLittleEndianInt32: 0xFFFFFFFF]; [stream writeLittleEndianInt32: 0xFFFFFFFF]; [stream writeLittleEndianInt16: (uint16_t)[_fileName UTF8StringLength]]; [stream writeLittleEndianInt16: (uint16_t)[_extraField count] + 32]; [stream writeLittleEndianInt16: (uint16_t)[_fileComment UTF8StringLength]]; [stream writeLittleEndianInt16: 0xFFFF]; [stream writeLittleEndianInt16: _internalAttributes]; [stream writeLittleEndianInt32: _versionSpecificAttributes]; [stream writeLittleEndianInt32: 0xFFFFFFFF]; size += (4 + (6 * 2) + (3 * 4) + (5 * 2) + (2 * 4)); [stream writeString: _fileName]; size += (uint64_t)[_fileName UTF8StringLength]; [stream writeLittleEndianInt16: OF_ZIP_ARCHIVE_ENTRY_EXTRA_FIELD_ZIP64]; [stream writeLittleEndianInt16: 28]; [stream writeLittleEndianInt64: _uncompressedSize]; [stream writeLittleEndianInt64: _compressedSize]; [stream writeLittleEndianInt64: _localFileHeaderOffset]; [stream writeLittleEndianInt32: _startDiskNumber]; size += (2 * 2) + (3 * 8) + 4; if (_extraField != nil) [stream writeData: _extraField]; size += (uint64_t)[_extraField count]; if (_fileComment != nil) [stream writeString: _fileComment]; size += (uint64_t)[_fileComment UTF8StringLength]; objc_autoreleasePoolPop(pool); return size; } @end |