🚧 Add debug output
This commit is contained in:
parent
ab1280d46c
commit
09fb2eed85
1 changed files with 2 additions and 0 deletions
|
@ -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. */
|
/** 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<Buffer> {
|
export default async function readBytesFromStream(inputStream: stream.Readable, length: number): Promise<Buffer> {
|
||||||
let localFileHeader: Buffer = inputStream.read(length);
|
let localFileHeader: Buffer = inputStream.read(length);
|
||||||
|
console.log(localFileHeader);
|
||||||
while (localFileHeader === null) {
|
while (localFileHeader === null) {
|
||||||
//need to wait until data is ready for reading
|
//need to wait until data is ready for reading
|
||||||
await waitReadableLength(inputStream, length);
|
await waitReadableLength(inputStream, length);
|
||||||
localFileHeader = inputStream.read(length);
|
localFileHeader = inputStream.read(length);
|
||||||
|
console.log(localFileHeader);
|
||||||
}
|
}
|
||||||
return localFileHeader;
|
return localFileHeader;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue