Skip to content

Commit

Permalink
Fix problem decoding tag array of type "B,C" (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso authored Oct 14, 2024
1 parent a2d681b commit e2b7d08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cramFile/slice/decodeRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e2b7d08

Please sign in to comment.