From e952f714df87b55e1c8021bb4e0a87965e0295e3 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Thu, 5 Jul 2018 02:18:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20Fix=20reading=20of=20local=20fil?= =?UTF-8?q?e=20header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/extractFileStream.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ssn/extractFileStream.ts b/src/ssn/extractFileStream.ts index a074647..43f9899 100644 --- a/src/ssn/extractFileStream.ts +++ b/src/ssn/extractFileStream.ts @@ -11,7 +11,8 @@ import streamSetMaxLength from './streams/streamSetMaxLength'; * and must transparently span across multiple disks if necessary. */ export default function extractFileStream(file: ISsnFileEntry, inputStream: stream.Readable): stream.Readable { - const localFileHeader = new DataView(inputStream.read(30)); + const headerBuffer: Buffer = inputStream.read(30); + const localFileHeader = new DataView(headerBuffer.buffer); //Local file header signature if (localFileHeader.getUint32(0, true) !== 0x04034B50) {