Skip to content

Commit b3ca940

Browse files
committed
Fix problem with offset in RBufferReader
1 parent bbf4840 commit b3ca940

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/rntuple.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class RBufferReader {
1818
throw new TypeError('Invalid buffer type');
1919

2020
this.view = new DataView(this.buffer);
21-
this.offset = 0;
21+
// important - offset should start from actual place in the buffer
22+
this.offset = this.byteOffset;
2223
}
2324

2425
// Move to a specific position in the buffer
@@ -729,6 +730,8 @@ async function readHeaderFooter(tuple) {
729730
size = Number(group.pageListLocator.size),
730731
uncompressedSize = Number(group.pageListLength);
731732

733+
console.log('reading in header', offset, size)
734+
732735
return tuple.$file.readBuffer([offset, size]).then(page_list_blob => {
733736
if (!(page_list_blob instanceof DataView))
734737
throw new Error(`Expected DataView from readBuffer, got ${Object.prototype.toString.call(page_list_blob)}`);

0 commit comments

Comments
 (0)