|
@@ 472-482 (lines=11) @@
|
| 469 |
|
return $num; |
| 470 |
|
} |
| 471 |
|
|
| 472 |
|
private function unpackUint64() |
| 473 |
|
{ |
| 474 |
|
if (!isset($this->buffer[$this->offset + 7])) { |
| 475 |
|
throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 8); |
| 476 |
|
} |
| 477 |
|
|
| 478 |
|
$num = \unpack('J', $this->buffer, $this->offset)[1]; |
| 479 |
|
$this->offset += 8; |
| 480 |
|
|
| 481 |
|
return $num < 0 ? $this->handleIntOverflow($num) : $num; |
| 482 |
|
} |
| 483 |
|
|
| 484 |
|
private function unpackInt8() |
| 485 |
|
{ |
|
@@ 509-519 (lines=11) @@
|
| 506 |
|
return $hi > 0x7f ? $hi << 8 | $lo - 0x10000 : $hi << 8 | $lo; |
| 507 |
|
} |
| 508 |
|
|
| 509 |
|
private function unpackInt32() |
| 510 |
|
{ |
| 511 |
|
if (!isset($this->buffer[$this->offset + 3])) { |
| 512 |
|
throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 4); |
| 513 |
|
} |
| 514 |
|
|
| 515 |
|
$num = \unpack('N', $this->buffer, $this->offset)[1]; |
| 516 |
|
$this->offset += 4; |
| 517 |
|
|
| 518 |
|
return $num > 0x7fffffff ? $num - 0x100000000 : $num; |
| 519 |
|
} |
| 520 |
|
|
| 521 |
|
private function unpackInt64() |
| 522 |
|
{ |