|
@@ 536-546 (lines=11) @@
|
| 533 |
|
return $num; |
| 534 |
|
} |
| 535 |
|
|
| 536 |
|
private function unpackUint64() |
| 537 |
|
{ |
| 538 |
|
if (!isset($this->buffer[$this->offset + 7])) { |
| 539 |
|
throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 8); |
| 540 |
|
} |
| 541 |
|
|
| 542 |
|
$num = \unpack('J', $this->buffer, $this->offset)[1]; |
| 543 |
|
$this->offset += 8; |
| 544 |
|
|
| 545 |
|
return $num < 0 ? $this->handleIntOverflow($num) : $num; |
| 546 |
|
} |
| 547 |
|
|
| 548 |
|
private function unpackInt8() |
| 549 |
|
{ |
|
@@ 573-583 (lines=11) @@
|
| 570 |
|
return $hi > 0x7f ? $hi << 8 | $lo - 0x10000 : $hi << 8 | $lo; |
| 571 |
|
} |
| 572 |
|
|
| 573 |
|
private function unpackInt32() |
| 574 |
|
{ |
| 575 |
|
if (!isset($this->buffer[$this->offset + 3])) { |
| 576 |
|
throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 4); |
| 577 |
|
} |
| 578 |
|
|
| 579 |
|
$num = \unpack('N', $this->buffer, $this->offset)[1]; |
| 580 |
|
$this->offset += 4; |
| 581 |
|
|
| 582 |
|
return $num > 0x7fffffff ? $num - 0x100000000 : $num; |
| 583 |
|
} |
| 584 |
|
|
| 585 |
|
private function unpackInt64() |
| 586 |
|
{ |