🚑 Fix reading of local file header

This commit is contained in:
C-3PO 2018-07-05 02:18:47 +02:00
parent 4fb3d1322c
commit e952f714df
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -11,7 +11,8 @@ import streamSetMaxLength from './streams/streamSetMaxLength';
* and must transparently span across multiple disks if necessary. * and must transparently span across multiple disks if necessary.
*/ */
export default function extractFileStream(file: ISsnFileEntry, inputStream: stream.Readable): stream.Readable { 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 //Local file header signature
if (localFileHeader.getUint32(0, true) !== 0x04034B50) { if (localFileHeader.getUint32(0, true) !== 0x04034B50) {