code: function _getBaiRefLength(uncba, offset) {
      var p = offset;
      var nbin = readInt(uncba, p); p += 4;
      for (var b = 0; b < nbin; ++b) {
          var bin = readInt(uncba, p);
          var nchnk = readInt(uncba, p+4);
          p += 8 + (nchnk * 16);
      }
      var nintv = readInt(uncba, p); p += 4;
  
      var minBlockIndex = 1000000000;
      var q = p;
      for (var i = 0; i < nintv; ++i) {
          var v = readVob(uncba, q); q += 8;
          if (v) {
              var bi = v.block;
              if (v.offset > 0)
                  bi += 65536;
  
              if (bi < minBlockIndex)
                  minBlockIndex = bi;
              break;
          }
      }
      p += (nintv * 8);
  
      return {
          minBlockIndex: minBlockIndex,
          nbin: nbin,
          length: p - offset
      };
  }
docs: Calculate the length (in bytes) of the BAI ref starting at offset. Returns {nbin, length, minBlockIndex}