protected function bufMagic(&$buf, $pri_min = 0, $pri_max = -1)
{
$pos = $this->uint32_at(24);
list($n, $max_extent, $pos) = $this->nuint32_at($pos, 3);
for ($i = 0; $i < $n; $i++, $pos += 16) {
list($pri, $type_off, $n_matchlets, $matchlets_off) = $this->nuint32_at($pos, 4);
/* entries are sorted by priority */
if ($pri < $pri_min) {
break;
}
if ($pri_max >= 0 && $pri > $pri_max) {
continue;
}
if ($this->bufMatchlets($buf, $matchlets_off, $n_matchlets)) {
return $this->string_at($type_off);
}
}
}