This commit aims to be as lazy as possible :
When reading a file, we now don't decompress the content, we just keep
a reference to the original compressed file and an offset.
If the user accesses a file, we will decompress it and replace the
content (so we don't have to decompress it again).
When generating a zip, if a file has not been decompressed we check if
we can reuse the compressed content.
This unfortunately means that we won't be backward compatible : the
data attribute may not be calculated yet. Worse, the data now can be a
string, an array or a UInt8Array. The user must use the getters !
The interface for compression/decompression has also changed : we now
specify the input type for each operation.
This has been tested in IE 6 -> 10, firefox, chrome, opera.
If anyone has an apple product with safari, he's welcome to test :)
str += 'char' is faster than array.push && array.join but the difference
is not big.
String are immutable so the concatenation will create n(n-1)/2 objects,
so a memory consumption in O(n^2). The array join is in O(n).
When working with large files (hundreds of Mb), O(n^2) is clearly not a
Also, use TextDecoder if available to boost perfs.