diff --git a/src/ssn/streams/arrayBufferToStream.ts b/src/ssn/streams/arrayBufferToStream.ts index 5d57eb9..518a08e 100644 --- a/src/ssn/streams/arrayBufferToStream.ts +++ b/src/ssn/streams/arrayBufferToStream.ts @@ -20,7 +20,7 @@ export default function arrayBufferToStream(arrayBuffer: ArrayBuffer, offset: nu do { //If end is reached if (position >= endPosition - 1) { - this.push(null); + outStream.push(null); return; } @@ -32,7 +32,7 @@ export default function arrayBufferToStream(arrayBuffer: ArrayBuffer, offset: nu //chunk.fill(arrayBuffer, position); //const chunk = Buffer.from(arrayBuffer, position, chunkSize); position += chunk.length; - needMoreData = this.push(chunk); + needMoreData = outStream.push(chunk); } while (needMoreData); }, });