--- a/ZipArchive.st Sat Feb 13 06:53:42 2016 +0100
+++ b/ZipArchive.st Sun Feb 14 06:59:54 2016 +0100
@@ -3438,8 +3438,8 @@
"
file position:fileHeaderStart+26.
- fileNameLength := file nextUnsignedShortMSB:false.
- extraFieldLength := file nextUnsignedShortMSB:false.
+ fileNameLength := file nextUnsignedInt16MSB:false.
+ extraFieldLength := file nextUnsignedInt16MSB:false.
dataStart := fileHeaderStart + 30 + fileNameLength + extraFieldLength.
@@ -3671,23 +3671,23 @@
self zipMembersDo:[:zipEntry |
noEntries := noEntries + 1.
- file nextPutLong: C_CENTRAL_HEADER_SIGNATURE MSB:false.
- file nextPutShort:zipEntry versionMadeBy MSB:false.
- file nextPutShort:zipEntry versionNeedToExtract MSB:false.
- file nextPutShort:zipEntry generalPurposBitFlag MSB:false.
- file nextPutShort:zipEntry compressionMethod MSB:false.
- file nextPutShort:zipEntry lastModFileTime MSB:false.
- file nextPutShort:zipEntry lastModFileDate MSB:false.
- file nextPutLong:zipEntry crc32 MSB:false.
- file nextPutLong:zipEntry compressedSize MSB:false.
- file nextPutLong:zipEntry uncompressedSize MSB:false.
- file nextPutShort:zipEntry fileNameLength MSB:false.
- file nextPutShort:zipEntry extraFieldLength MSB:false.
- file nextPutShort:zipEntry fileCommentLength MSB:false.
- file nextPutShort:zipEntry diskNumberStart MSB:false.
- file nextPutShort:zipEntry internalFileAttributes MSB:false.
- file nextPutLong:zipEntry externalFileAttributes MSB:false.
- file nextPutLong:zipEntry relativeLocalHeaderOffset MSB:false.
+ file nextPutInt32: C_CENTRAL_HEADER_SIGNATURE MSB:false.
+ file nextPutInt16:zipEntry versionMadeBy MSB:false.
+ file nextPutInt16:zipEntry versionNeedToExtract MSB:false.
+ file nextPutInt16:zipEntry generalPurposBitFlag MSB:false.
+ file nextPutInt16:zipEntry compressionMethod MSB:false.
+ file nextPutInt16:zipEntry lastModFileTime MSB:false.
+ file nextPutInt16:zipEntry lastModFileDate MSB:false.
+ file nextPutInt32:zipEntry crc32 MSB:false.
+ file nextPutInt32:zipEntry compressedSize MSB:false.
+ file nextPutInt32:zipEntry uncompressedSize MSB:false.
+ file nextPutInt16:zipEntry fileNameLength MSB:false.
+ file nextPutInt16:zipEntry extraFieldLength MSB:false.
+ file nextPutInt16:zipEntry fileCommentLength MSB:false.
+ file nextPutInt16:zipEntry diskNumberStart MSB:false.
+ file nextPutInt16:zipEntry internalFileAttributes MSB:false.
+ file nextPutInt32:zipEntry externalFileAttributes MSB:false.
+ file nextPutInt32:zipEntry relativeLocalHeaderOffset MSB:false.
self assert:zipEntry fileNameLength = zipEntry fileName size.
file nextPutAll:zipEntry fileName.
@@ -3710,13 +3710,13 @@
file nextPutByte:($K codePoint).
file nextPutByte:8r005.
file nextPutByte:8r006.
- file nextPutShort:centralDirectory numberOfThisDisk MSB:false.
- file nextPutShort:centralDirectory centralDirectoryStartDiskNumber MSB:false.
- file nextPutShort:centralDirectory centralDirectoryTotalNoOfEntriesOnThisDisk MSB:false.
- file nextPutShort:centralDirectory centralDirectoryTotalNoOfEntries MSB:false.
- file nextPutLong:centralDirectory centralDirectorySize MSB:false.
- file nextPutLong:centralDirectory centralDirectoryStartOffset MSB:false.
- file nextPutShort:centralDirectory zipCommentLength MSB:false.
+ file nextPutInt16:centralDirectory numberOfThisDisk MSB:false.
+ file nextPutInt16:centralDirectory centralDirectoryStartDiskNumber MSB:false.
+ file nextPutInt16:centralDirectory centralDirectoryTotalNoOfEntriesOnThisDisk MSB:false.
+ file nextPutInt16:centralDirectory centralDirectoryTotalNoOfEntries MSB:false.
+ file nextPutInt32:centralDirectory centralDirectorySize MSB:false.
+ file nextPutInt32:centralDirectory centralDirectoryStartOffset MSB:false.
+ file nextPutInt16:centralDirectory zipCommentLength MSB:false.
centralDirectory zipCommentLength ~~ 0 ifTrue: [
file nextPutAll: centralDirectory zipComment.
@@ -3883,7 +3883,7 @@
(file position + (self class centralDirectoryMinimumSize)) > endOfArchive ifTrue: [
^ ZipFileFormatErrorSignal raiseRequestErrorString:' - central directory entry out of archive bounds'.
].
- centralFileHeaderSignature := file nextLongMSB:false.
+ centralFileHeaderSignature := file nextInt32MSB:false.
centralFileHeaderSignature ~= C_CENTRAL_HEADER_SIGNATURE ifTrue:[
ZipFileFormatErrorSignal raiseRequestErrorString:' - file format error - bad centralHeaderSignature in: ' ,
(file isFileStream ifTrue:[file pathName] ifFalse:['inStream']).
@@ -3992,7 +3992,6 @@
^ false.
! !
-
!ZipArchive methodsFor:'reading'!
extract:fileName
@@ -4102,7 +4101,6 @@
"Created: / 21-11-2010 / 11:51:41 / cg"
! !
-
!ZipArchive methodsFor:'reading - stream'!
extract:fileName intoStream: aWriteStream
@@ -4645,7 +4643,7 @@
readDigitalSignatureFrom:aStream
"read a digitalSignature trailer from aStream"
- digitalSignatureDataSize := aStream nextUnsignedShortMSB:false.
+ digitalSignatureDataSize := aStream nextUnsignedInt16MSB:false.
digitalSignatureDataSize ~~ 0 ifTrue:[
"/ (file position + (centralDirectory digitalSignatureDataSize)) > endOfArchive ifTrue: [
"/ ^ ZipFileFormatErrorSignal raiseRequestErrorString:' - digital signature entry out of archive bounds'.
@@ -4658,13 +4656,13 @@
readFrom:aStream
"read a Central Directory Header from aStream"
- numberOfThisDisk := aStream nextUnsignedShortMSB:false.
- centralDirectoryStartDiskNumber := aStream nextUnsignedShortMSB:false.
- centralDirectoryTotalNoOfEntriesOnThisDisk := aStream nextUnsignedShortMSB:false.
- centralDirectoryTotalNoOfEntries := aStream nextUnsignedShortMSB:false.
- centralDirectorySize := aStream nextLongMSB:false.
- centralDirectoryStartOffset := aStream nextLongMSB:false.
- zipCommentLength := aStream nextUnsignedShortMSB:false.
+ numberOfThisDisk := aStream nextUnsignedInt16MSB:false.
+ centralDirectoryStartDiskNumber := aStream nextUnsignedInt16MSB:false.
+ centralDirectoryTotalNoOfEntriesOnThisDisk := aStream nextUnsignedInt16MSB:false.
+ centralDirectoryTotalNoOfEntries := aStream nextUnsignedInt16MSB:false.
+ centralDirectorySize := aStream nextInt32MSB:false.
+ centralDirectoryStartOffset := aStream nextInt32MSB:false.
+ zipCommentLength := aStream nextUnsignedInt16MSB:false.
zipCommentLength ~~ 0 ifTrue: [
zipComment := String new:zipCommentLength.
aStream nextBytes:zipCommentLength into:zipComment.
@@ -4949,22 +4947,22 @@
readCentralDirectoryEntryFrom:aStream
"read a central directory entry"
- versionMadeBy := aStream nextUnsignedShortMSB:false.
- versionNeedToExtract := aStream nextUnsignedShortMSB:false.
- generalPurposBitFlag := aStream nextUnsignedShortMSB:false.
- compressionMethod := aStream nextUnsignedShortMSB:false.
- lastModFileTime := aStream nextUnsignedShortMSB:false.
- lastModFileDate := aStream nextUnsignedShortMSB:false.
- crc32 := aStream nextUnsignedLongMSB: false.
- compressedSize := aStream nextUnsignedLongMSB:false.
- uncompressedSize := aStream nextUnsignedLongMSB:false.
- fileNameLength := aStream nextUnsignedShortMSB:false.
- extraFieldLength := aStream nextUnsignedShortMSB:false.
- fileCommentLength := aStream nextUnsignedShortMSB:false.
- diskNumberStart := aStream nextUnsignedShortMSB:false.
- internalFileAttributes := aStream nextUnsignedShortMSB:false.
- externalFileAttributes := aStream nextUnsignedLongMSB:false.
- relativeLocalHeaderOffset := aStream nextUnsignedLongMSB:false.
+ versionMadeBy := aStream nextUnsignedInt16MSB:false.
+ versionNeedToExtract := aStream nextUnsignedInt16MSB:false.
+ generalPurposBitFlag := aStream nextUnsignedInt16MSB:false.
+ compressionMethod := aStream nextUnsignedInt16MSB:false.
+ lastModFileTime := aStream nextUnsignedInt16MSB:false.
+ lastModFileDate := aStream nextUnsignedInt16MSB:false.
+ crc32 := aStream nextUnsignedInt32MSB: false.
+ compressedSize := aStream nextUnsignedInt32MSB:false.
+ uncompressedSize := aStream nextUnsignedInt32MSB:false.
+ fileNameLength := aStream nextUnsignedInt16MSB:false.
+ extraFieldLength := aStream nextUnsignedInt16MSB:false.
+ fileCommentLength := aStream nextUnsignedInt16MSB:false.
+ diskNumberStart := aStream nextUnsignedInt16MSB:false.
+ internalFileAttributes := aStream nextUnsignedInt16MSB:false.
+ externalFileAttributes := aStream nextUnsignedInt32MSB:false.
+ relativeLocalHeaderOffset := aStream nextUnsignedInt32MSB:false.
"/ (aStream position + fileNameLength) > endOfArchive ifTrue: [
"/ ^ ZipArchive zipFileFormatErrorSignal raiseRequestErrorString:' - central directory entry out of archive bounds'.
@@ -4995,9 +4993,9 @@
aStream position:relativeLocalHeaderOffset+14.
aStream
- nextPutLong:crc32 MSB:false;
- nextPutLong:compressedSize MSB:false;
- nextPutLong:uncompressedSize MSB:false.
+ nextPutInt32:crc32 MSB:false;
+ nextPutInt32:compressedSize MSB:false;
+ nextPutInt32:uncompressedSize MSB:false.
!
writeTo:aStream
@@ -5006,17 +5004,17 @@
relativeLocalHeaderOffset := aStream position.
aStream
- nextPutLong:C_LOCAL_HEADER_SIGNATURE MSB:false;
- nextPutShort:versionNeedToExtract MSB:false;
- nextPutShort:generalPurposBitFlag MSB:false;
- nextPutShort:compressionMethod MSB:false;
- nextPutShort:lastModFileTime MSB:false;
- nextPutShort:lastModFileDate MSB:false;
- nextPutLong:crc32 MSB:false;
- nextPutLong:compressedSize MSB:false;
- nextPutLong:uncompressedSize MSB:false;
- nextPutShort:fileNameLength MSB:false;
- nextPutShort:extraFieldLength MSB:false;
+ nextPutInt32:C_LOCAL_HEADER_SIGNATURE MSB:false;
+ nextPutInt16:versionNeedToExtract MSB:false;
+ nextPutInt16:generalPurposBitFlag MSB:false;
+ nextPutInt16:compressionMethod MSB:false;
+ nextPutInt16:lastModFileTime MSB:false;
+ nextPutInt16:lastModFileDate MSB:false;
+ nextPutInt32:crc32 MSB:false;
+ nextPutInt32:compressedSize MSB:false;
+ nextPutInt32:uncompressedSize MSB:false;
+ nextPutInt16:fileNameLength MSB:false;
+ nextPutInt16:extraFieldLength MSB:false;
nextPutAll:fileName.
extraField notNil ifTrue: [