Skip to content

Commit ae0185f

Browse files
committed
Provide custom streamer for old TBranch versions
For version 9 and below custom streamer was used for TBranch
1 parent d3f02ef commit ae0185f

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

modules/io.mjs

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,36 @@ CustomStreamers = {
376376
},
377377

378378
TBranch(buf, obj) {
379-
if (buf.last_read_version > 9)
380-
buf.streamClassMembers(obj, 'TBranch', buf.last_read_version, buf.last_read_checksum);
381-
379+
const v = buf.last_read_version;
380+
if (v > 9)
381+
buf.streamClassMembers(obj, 'TBranch', v);
382+
else {
383+
buf.classStreamer(obj, clTNamed);
384+
if (v > 7)
385+
buf.classStreamer(obj, clTAttFill);
386+
obj.fCompress = buf.ntoi4();
387+
obj.fBasketSize = buf.ntoi4();
388+
obj.fEntryOffsetLen = buf.ntoi4();
389+
obj.fWriteBasket = buf.ntoi4();
390+
obj.fEntryNumber = buf.ntoi4();
391+
obj.fOffset = buf.ntoi4();
392+
obj.fMaxBaskets = buf.ntoi4();
393+
if (v > 6)
394+
obj.fSplitLevel = buf.ntoi4();
395+
obj.fEntries = buf.ntod();
396+
obj.fTotBytes = buf.ntod();
397+
obj.fZipBytes = buf.ntod();
398+
obj.fBranches = buf.classStreamer({}, clTObjArray);
399+
obj.fLeaves = buf.classStreamer({}, clTObjArray);
400+
obj.fBaskets = buf.classStreamer({}, clTObjArray);
401+
buf.ntoi1(); // isArray
402+
obj.fBasketBytes = buf.readFastArray(obj.fMaxBaskets, kInt);
403+
buf.ntoi1(); // isArray
404+
obj.fBasketEntry = buf.readFastArray(obj.fMaxBaskets, kInt);
405+
const isArray = buf.ntoi1();
406+
obj.fBasketSeek = buf.readFastArray(obj.fMaxBaskets, isArray === 2 ? kLong64 : kInt);
407+
obj.fFileName = buf.readTString();
408+
}
382409
},
383410

384411
'ROOT::RNTuple': {

0 commit comments

Comments
 (0)