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) {