js/twoBit.js
function() {
            while (i < tb.seqCount) {
                var ns = ba[p];
                if (p + ns + 2 + (tb.version == 0 ? 4 : 8) >= ba.length) {
                    headerBlocksFetched += headerBlockSize;
                    headerBlockSize = Math.max(HEADER_BLOCK_SIZE,Math.floor(headerBlocksFetched*tb.seqCount/i));
                    return tb.data.slice(o + p, headerBlockSize).fetch(function (r) {
                        o += p;
                        p = 0;
                        ba = new Uint8Array(r);
                        parseSeqInfo();
                    });
                } else {
                    ++p;
                    var name = '';
                    for (var j = 1; j <= ns; ++j) {
                        name += String.fromCharCode(ba[p++]);
                    }
                    if (tb.version == 0) {
                        var offset = tb.readInt(ba, p);
                        p += 4;
                    } else {
                        var offset = tb.readInt64(ba, p);
                        p += 8;
                    }
                    tb.seqDict[name] = new TwoBitSeq(tb, offset);
                    ++i;
                }
            }
            return cnt(tb);
        }
function() {
            while (i < tb.seqCount) {
                var ns = ba[p];
                if (p + ns + 2 + (tb.version == 0 ? 4 : 8) >= ba.length) {
                    headerBlocksFetched += headerBlockSize;
                    headerBlockSize = Math.max(HEADER_BLOCK_SIZE,Math.floor(headerBlocksFetched*tb.seqCount/i));
                    return tb.data.slice(o + p, headerBlockSize).fetch(function (r) {
                        o += p;
                        p = 0;
                        ba = new Uint8Array(r);
                        parseSeqInfo();
                    });
                } else {
                    ++p;
                    var name = '';
                    for (var j = 1; j <= ns; ++j) {
                        name += String.fromCharCode(ba[p++]);
                    }
                    if (tb.version == 0) {
                        var offset = tb.readInt(ba, p);
                        p += 4;
                    } else {
                        var offset = tb.readInt64(ba, p);
                        p += 8;
                    }
                    tb.seqDict[name] = new TwoBitSeq(tb, offset);
                    ++i;
                }
            }
            return cnt(tb);
        }
function ( ) { while ( i < tb . seqCount ) { var ns = ba [ p ] ; if ( p + ns + 2 + ( tb . version == 0 ? 4 : 8 ) >= ba . length ) { headerBlocksFetched += headerBlockSize ; headerBlockSize = Math . max ( HEADER_BLOCK_SIZE , Math . floor ( headerBlocksFetched * tb . seqCount / i ) ) ; return tb . data . slice ( o + p , headerBlockSize ) . fetch ( function ( r ) { o += p ; p = 0 ; ba = new Uint8Array ( r ) ; parseSeqInfo ( ) ; } ) ; } else { ++ p ; var name = '' ; for ( var j = 1 ; j <= ns ; ++ j ) { name += String . fromCharCode ( ba [ p ++ ] ) ; } if ( tb . version == 0 ) { var offset = tb . readInt ( ba , p ) ; p += 4 ; } else { var offset = tb . readInt64 ( ba , p ) ; p += 8 ; } tb . seqDict [ name ] = new TwoBitSeq ( tb , offset ) ; ++ i ; } } return cnt ( tb ) ; }
Offset of the current block if we need to fetch multiple header blocks.
Offset of the current block if we need to fetch multiple header blocks .