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; }