1
1
/*!
2
2
3
- JSZip v3.2.1 - A JavaScript class for generating and reading zip files
3
+ JSZip v3.2.2 - A JavaScript class for generating and reading zip files
4
4
<http://stuartk.com/jszip>
5
5
6
6
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
@@ -1859,6 +1859,22 @@ DataReader.prototype = {
1859
1859
this . index += size ;
1860
1860
return result ;
1861
1861
} ,
1862
+ /**
1863
+ * Get the next number with a given byte size.
1864
+ * Same as readInt but using * 256 so there is no conversion to int32.
1865
+ * @param {number } size the number of bytes to read.
1866
+ * @return {number } the corresponding number.
1867
+ */
1868
+ readLong : function ( size ) {
1869
+ var result = 0 ,
1870
+ i ;
1871
+ this . checkOffset ( size ) ;
1872
+ for ( i = this . index + size - 1 ; i >= this . index ; i -- ) {
1873
+ result = ( result * 256 ) + this . byteAt ( i ) ;
1874
+ }
1875
+ this . index += size ;
1876
+ return result ;
1877
+ } ,
1862
1878
/**
1863
1879
* Get the next string with a given byte size.
1864
1880
* @param {number } size the number of bytes to read.
@@ -3950,13 +3966,13 @@ ZipEntry.prototype = {
3950
3966
// I really hope that these 64bits integer can fit in 32 bits integer, because js
3951
3967
// won't let us have more.
3952
3968
if ( this . uncompressedSize === utils . MAX_VALUE_32BITS ) {
3953
- this . uncompressedSize = extraReader . readInt ( 8 ) ;
3969
+ this . uncompressedSize = extraReader . readLong ( 8 ) ;
3954
3970
}
3955
3971
if ( this . compressedSize === utils . MAX_VALUE_32BITS ) {
3956
- this . compressedSize = extraReader . readInt ( 8 ) ;
3972
+ this . compressedSize = extraReader . readLong ( 8 ) ;
3957
3973
}
3958
3974
if ( this . localHeaderOffset === utils . MAX_VALUE_32BITS ) {
3959
- this . localHeaderOffset = extraReader . readInt ( 8 ) ;
3975
+ this . localHeaderOffset = extraReader . readLong ( 8 ) ;
3960
3976
}
3961
3977
if ( this . diskNumberStart === utils . MAX_VALUE_32BITS ) {
3962
3978
this . diskNumberStart = extraReader . readInt ( 4 ) ;
@@ -4608,7 +4624,7 @@ var Z_DEFLATED = 8;
4608
4624
/* internal
4609
4625
* Deflate.chunks -> Array
4610
4626
*
4611
- * Chunks of output data, if [[Deflate#onData]] not overridden .
4627
+ * Chunks of output data, if [[Deflate#onData]] not overriden .
4612
4628
**/
4613
4629
4614
4630
/**
@@ -4850,7 +4866,7 @@ Deflate.prototype.push = function (data, mode) {
4850
4866
4851
4867
/**
4852
4868
* Deflate#onData(chunk) -> Void
4853
- * - chunk (Uint8Array|Array|String): output data. Type of array depends
4869
+ * - chunk (Uint8Array|Array|String): ouput data. Type of array depends
4854
4870
* on js engine support. When string output requested, each chunk
4855
4871
* will be string.
4856
4872
*
@@ -4993,7 +5009,7 @@ var toString = Object.prototype.toString;
4993
5009
/* internal
4994
5010
* inflate.chunks -> Array
4995
5011
*
4996
- * Chunks of output data, if [[Inflate#onData]] not overridden .
5012
+ * Chunks of output data, if [[Inflate#onData]] not overriden .
4997
5013
**/
4998
5014
4999
5015
/**
@@ -5268,7 +5284,7 @@ Inflate.prototype.push = function (data, mode) {
5268
5284
5269
5285
/**
5270
5286
* Inflate#onData(chunk) -> Void
5271
- * - chunk (Uint8Array|Array|String): output data. Type of array depends
5287
+ * - chunk (Uint8Array|Array|String): ouput data. Type of array depends
5272
5288
* on js engine support. When string output requested, each chunk
5273
5289
* will be string.
5274
5290
*
@@ -5295,7 +5311,7 @@ Inflate.prototype.onEnd = function (status) {
5295
5311
if ( status === c . Z_OK ) {
5296
5312
if ( this . options . to === 'string' ) {
5297
5313
// Glue & convert here, until we teach pako to send
5298
- // utf8 aligned strings to onData
5314
+ // utf8 alligned strings to onData
5299
5315
this . result = this . chunks . join ( '' ) ;
5300
5316
} else {
5301
5317
this . result = utils . flattenChunks ( this . chunks ) ;
0 commit comments