Updated a range of operations to use ArrayBuffers instead of byteArrays to improve performance with large files.

This commit is contained in:
n1474335 2019-07-29 17:09:46 +01:00
parent 3a8b362dfd
commit 0e95ad8ed6
37 changed files with 112 additions and 84 deletions

View file

@ -25,17 +25,18 @@ class ToQuotedPrintable extends Operation {
this.module = "Default";
this.description = "Quoted-Printable, or QP encoding, is an encoding using printable ASCII characters (alphanumeric and the equals sign '=') to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. It is defined as a MIME content transfer encoding for use in e-mail.<br><br>QP works by using the equals sign '=' as an escape character. It also limits line length to 76, as some software has limits on line length.";
this.infoURL = "https://wikipedia.org/wiki/Quoted-printable";
this.inputType = "byteArray";
this.inputType = "ArrayBuffer";
this.outputType = "string";
this.args = [];
}
/**
* @param {byteArray} input
* @param {ArrayBuffer} input
* @param {Object[]} args
* @returns {string}
*/
run(input, args) {
input = new Uint8Array(input);
let mimeEncodedStr = this.mimeEncode(input);
// fix line breaks
@ -73,7 +74,7 @@ class ToQuotedPrintable extends Operation {
/**
* Encodes mime data.
*
* @param {byteArray} buffer
* @param {byteArray|Uint8Array} buffer
* @returns {string}
*/
mimeEncode(buffer) {