From 09fb2eed854cf30724b01f10201a533ac5eb38f2 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Sun, 8 Jul 2018 22:02:27 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Add=20debug=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/streams/readBytesFromStream.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ssn/streams/readBytesFromStream.ts b/src/ssn/streams/readBytesFromStream.ts index 6f5a490..145f935 100644 --- a/src/ssn/streams/readBytesFromStream.ts +++ b/src/ssn/streams/readBytesFromStream.ts @@ -15,10 +15,12 @@ function waitReadableLength(inputStream: stream.Readable, minLength: number): Pr /** Reads the given number of bytes from the stream and returns them as a buffer, optionally waiting until the bytes are ready for reading. */ export default async function readBytesFromStream(inputStream: stream.Readable, length: number): Promise { let localFileHeader: Buffer = inputStream.read(length); + console.log(localFileHeader); while (localFileHeader === null) { //need to wait until data is ready for reading await waitReadableLength(inputStream, length); localFileHeader = inputStream.read(length); + console.log(localFileHeader); } return localFileHeader; }