(file)
| 12671 | * @return {String|ArrayBuffer|Uint8Array|Buffer} the data. |
| 12672 | */ |
| 12673 | var getRawData = function(file) { |
| 12674 | if (file._data instanceof CompressedObject) { |
| 12675 | file._data = file._data.getContent(); |
| 12676 | file.options.binary = true; |
| 12677 | file.options.base64 = false; |
| 12678 | |
| 12679 | if (utils.getTypeOf(file._data) === "uint8array") { |
| 12680 | var copy = file._data; |
| 12681 | // when reading an arraybuffer, the CompressedObject mechanism will keep it and subarray() a Uint8Array. |
| 12682 | // if we request a file in the same format, we might get the same Uint8Array or its ArrayBuffer (the original zip file). |
| 12683 | file._data = new Uint8Array(copy.length); |
| 12684 | // with an empty Uint8Array, Opera fails with a "Offset larger than array size" |
| 12685 | if (copy.length !== 0) { |
| 12686 | file._data.set(copy, 0); |
| 12687 | } |
| 12688 | } |
| 12689 | } |
| 12690 | return file._data; |
| 12691 | }; |
| 12692 | |
| 12693 | /** |
| 12694 | * Returns the data of a ZipObject in a binary form. If the content is an unicode string, encode it. |
no test coverage detected