import { Reader } from "https://dotland.deno.dev/x/zipjs@v2.7.42/index.js";
Represents an instance used to read unknown type of data.
Examples
Here is an example of custom Reader class used to read binary strings:
Here is an example of custom Reader class used to read binary strings:
class BinaryStringReader extends Reader {
constructor(binaryString) {
super();
this.binaryString = binaryString;
}
init() {
super.init();
this.size = this.binaryString.length;
}
readUint8Array(offset, length) {
const result = new Uint8Array(length);
for (let indexCharacter = 0; indexCharacter < length; indexCharacter++) {
result[indexCharacter] = this.binaryString.charCodeAt(indexCharacter + offset) & 0xFF;
}
return result;
}
}