mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-03 07:13:51 +00:00
test[php]: php protocol test
This commit is contained in:
1 parent
60ec9a71d7
commit
8d343b30a0
2 files changed
+8
-8
No files matched your search
@@ -61,8 +61,8 @@ class ByteBuffer
|
||||
public function setWriteOffset(int $writeIndex): void
|
||||
{
|
||||
if ($writeIndex > strlen($this->buffer)) {
|
||||
throw new Exception("writeIndex[" . $writeIndex . "] out of bounds exception: readerIndex: " . $this->readOffset .
|
||||
", writerIndex: " . $this->writeOffset . "(expected: 0 <= readerIndex <= writerIndex <= capacity:" . strlen($this->buffer));
|
||||
throw new Exception("writeIndex[" . $writeIndex . "] out of bounds exception: readOffset: " . $this->readOffset .
|
||||
", writeOffset: " . $this->writeOffset . "(expected: 0 <= readOffset <= writeOffset <= capacity:" . strlen($this->buffer) . ")");
|
||||
}
|
||||
$this->writeOffset = $writeIndex;
|
||||
}
|
||||
@@ -78,8 +78,8 @@ class ByteBuffer
|
||||
public function setReadOffset(int $readIndex): void
|
||||
{
|
||||
if ($readIndex > $this->writeOffset) {
|
||||
throw new Exception("readIndex[" . $readIndex . "] out of bounds exception: readerIndex: " . $this->readOffset .
|
||||
", writerIndex: " . $this->writeOffset . "(expected: 0 <= readerIndex <= writerIndex <= capacity:" . strlen($this->buffer));
|
||||
throw new Exception("readIndex[" . $readIndex . "] out of bounds exception: readOffset: " . $this->readOffset .
|
||||
", writeOffset: " . $this->writeOffset . "(expected: 0 <= readOffset <= writeOffset <= capacity:" . strlen($this->buffer));
|
||||
}
|
||||
$this->readOffset = $readIndex;
|
||||
}
|
||||
|
||||
@@ -61,8 +61,8 @@ class ByteBuffer
|
||||
public function setWriteOffset(int $writeIndex): void
|
||||
{
|
||||
if ($writeIndex > strlen($this->buffer)) {
|
||||
throw new Exception("writeIndex[" . $writeIndex . "] out of bounds exception: readerIndex: " . $this->readOffset .
|
||||
", writerIndex: " . $this->writeOffset . "(expected: 0 <= readerIndex <= writerIndex <= capacity:" . strlen($this->buffer));
|
||||
throw new Exception("writeIndex[" . $writeIndex . "] out of bounds exception: readOffset: " . $this->readOffset .
|
||||
", writeOffset: " . $this->writeOffset . "(expected: 0 <= readOffset <= writeOffset <= capacity:" . strlen($this->buffer) . ")");
|
||||
}
|
||||
$this->writeOffset = $writeIndex;
|
||||
}
|
||||
@@ -78,8 +78,8 @@ class ByteBuffer
|
||||
public function setReadOffset(int $readIndex): void
|
||||
{
|
||||
if ($readIndex > $this->writeOffset) {
|
||||
throw new Exception("readIndex[" . $readIndex . "] out of bounds exception: readerIndex: " . $this->readOffset .
|
||||
", writerIndex: " . $this->writeOffset . "(expected: 0 <= readerIndex <= writerIndex <= capacity:" . strlen($this->buffer));
|
||||
throw new Exception("readIndex[" . $readIndex . "] out of bounds exception: readOffset: " . $this->readOffset .
|
||||
", writeOffset: " . $this->writeOffset . "(expected: 0 <= readOffset <= writeOffset <= capacity:" . strlen($this->buffer));
|
||||
}
|
||||
$this->readOffset = $readIndex;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user