You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Buffer is extends Uint8Array, so I pass it to Uint8ArrayReader
When Buffer(child) is slice from another Buffer(parent) and offset is not 0,
at zip-reader#seekSignature, line 513, bytes type is Buffer, so after slice's buffer is parent's data....
Buffer's slice only mark offset and length, original is keep,
in it's document: To copy the slice, use`Uint8Array.prototype.slice()
my test code(not complete):
`class Reader implements Readable {
private readonly buffer: Buffer;
constructor(buffer: Buffer) {
this.buffer = buffer;
}
public get size(): number {
return this.buffer.length;
}
async init(): Promise<void> {
}
async read(index: number, length: number): Promise<Uint8Array> {
//return Uint8Array.prototype.slice.call(this.buffer, index, index + length);
return this.buffer.slice(index, index + length);
}
close(): void {
}
}
it('Readable', async () => {
const reader = new Reader(buff);
const zip = new Zip(reader);
zip.names().then(n => console.log(n))
});`
The text was updated successfully, but these errors were encountered:
To circumvent this issue due to Node.js, you have to transform the Buffer object into a Uint8Array object. This kind of issue is why zip.js is not officially supported in Node.js.
Buffer is extends Uint8Array, so I pass it to Uint8ArrayReader
When Buffer(child) is slice from another Buffer(parent) and offset is not 0,
at zip-reader#seekSignature, line 513, bytes type is Buffer, so after slice's buffer is parent's data....
Buffer's slice only mark offset and length, original is keep,
in it's document: To copy the slice, use`Uint8Array.prototype.slice()
my test code(not complete):
`class Reader implements Readable {
The text was updated successfully, but these errors were encountered: