diff --git a/build/main.cjs b/build/main.cjs index ffc7dd1..5164dd3 100644 --- a/build/main.cjs +++ b/build/main.cjs @@ -5112,7 +5112,7 @@ class BigBuffer { // bytes to copy from this page const l = (o+r > PAGE_SIZE) ? (PAGE_SIZE -o) : r; const srcView = new Uint8Array(this.buffers[p].buffer, this.buffers[p].byteOffset+o, l); - if (l == len) return srcView; + if (l == len) return srcView.slice(); if (!buff) { if (len <= PAGE_SIZE) { buff = new Uint8Array(len); diff --git a/src/bigbuffer.js b/src/bigbuffer.js index 2e74789..9604f74 100644 --- a/src/bigbuffer.js +++ b/src/bigbuffer.js @@ -30,7 +30,7 @@ export default class BigBuffer { // bytes to copy from this page const l = (o+r > PAGE_SIZE) ? (PAGE_SIZE -o) : r; const srcView = new Uint8Array(this.buffers[p].buffer, this.buffers[p].byteOffset+o, l); - if (l == len) return srcView; + if (l == len) return srcView.slice(); if (!buff) { if (len <= PAGE_SIZE) { buff = new Uint8Array(len);