Differences From Artifact [768704fed7]:
- File src/OFZIPArchiveEntry.m — part of check-in [cfd374b906] at 2015-01-03 20:57:18 on branch trunk — Update copyright (user: js, size: 8752) [annotate] [blame] [check-ins using]
To Artifact [f9630635cf]:
- File
src/OFZIPArchiveEntry.m
— part of check-in
[aa1bb213e0]
at
2015-05-09 21:29:43
on branch trunk
— OFZIPArchive: Remove OFFile requirement
Every OFSeekableStream can be used now. (user: js, size: 8795) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
139 140 141 142 143 144 145 | } *data = NULL; *size = 0; } @implementation OFZIPArchiveEntry | | | | | | | | | | | | | | | | | | | | | | | | | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | } *data = NULL; *size = 0; } @implementation OFZIPArchiveEntry - (instancetype)OF_initWithStream: (OFStream*)stream { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); uint16_t fileNameLength, extraFieldLength, fileCommentLength; of_string_encoding_t encoding; uint8_t *ZIP64 = NULL; uint16_t ZIP64Size; if ([stream readLittleEndianInt32] != 0x02014B50) @throw [OFInvalidFormatException exception]; _versionMadeBy = [stream readLittleEndianInt16]; _minVersionNeeded = [stream readLittleEndianInt16]; _generalPurposeBitFlag = [stream readLittleEndianInt16]; _compressionMethod = [stream readLittleEndianInt16]; _lastModifiedFileTime = [stream readLittleEndianInt16]; _lastModifiedFileDate = [stream readLittleEndianInt16]; _CRC32 = [stream readLittleEndianInt32]; _compressedSize = [stream readLittleEndianInt32]; _uncompressedSize = [stream readLittleEndianInt32]; fileNameLength = [stream readLittleEndianInt16]; extraFieldLength = [stream readLittleEndianInt16]; fileCommentLength = [stream readLittleEndianInt16]; _startDiskNumber = [stream readLittleEndianInt16]; _internalAttributes = [stream readLittleEndianInt16]; _versionSpecificAttributes = [stream readLittleEndianInt32]; _localFileHeaderOffset = [stream readLittleEndianInt32]; encoding = (_generalPurposeBitFlag & (1 << 11) ? OF_STRING_ENCODING_UTF_8 : OF_STRING_ENCODING_CODEPAGE_437); _fileName = [[stream readStringWithLength: fileNameLength encoding: encoding] copy]; _extraField = [[stream readDataArrayWithCount: extraFieldLength] retain]; _fileComment = [[stream readStringWithLength: fileCommentLength encoding: encoding] copy]; of_zip_archive_entry_extra_field_find(_extraField, OF_ZIP_ARCHIVE_ENTRY_EXTRA_FIELD_ZIP64, &ZIP64, &ZIP64Size); if (ZIP64 != NULL) { if (_uncompressedSize == 0xFFFFFFFF) _uncompressedSize = of_zip_archive_read_field64( |
︙ | ︙ |