import { Writer } from "https://dotland.deno.dev/x/zipjs@v2.6.68/index.js";
Represents an instance used to write unknown type of data.
Examples
Here is an example of custom Writer class used to write binary strings:
Here is an example of custom Writer class used to write binary strings:
class BinaryStringWriter extends Writer {
constructor() {
super();
this.binaryString = "";
}
writeUint8Array(array) {
for (let indexCharacter = 0; indexCharacter < array.length; indexCharacter++) {
this.binaryString += String.fromCharCode(array[indexCharacter]);
}
}
getData() {
return this.binaryString;
}
}