diff --git a/src/cramFile/slice/decodeRecord.ts b/src/cramFile/slice/decodeRecord.ts index 1296e3eb..2a0d8b34 100644 --- a/src/cramFile/slice/decodeRecord.ts +++ b/src/cramFile/slice/decodeRecord.ts @@ -32,7 +32,10 @@ function readNullTerminatedString(buffer: Uint8Array) { */ function parseTagValueArray(buffer: Uint8Array) { const arrayType = String.fromCharCode(buffer[0]!) - const length = Int32Array.from(buffer.slice(1))[0]! + + const dataView = new DataView(buffer.buffer) + const littleEndian = true + const length = dataView.getUint32(1, littleEndian) const array: number[] = new Array(length) buffer = buffer.slice(5)