mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-13 00:15:24 +00:00
ref[es]: es protocol
This commit is contained in:
1 parent
6fbb0b90fb
commit
04d80e1c61
2 files changed
+14
-14
No files matched your search
@@ -87,7 +87,7 @@ class ByteBuffer {
|
||||
if (writeIndex > this.buffer.byteLength) {
|
||||
throw new Error('writeIndex out of bounds exception: readOffset: ' + this.readOffset +
|
||||
', writeOffset: ' + this.writeOffset +
|
||||
'(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength) + ')';
|
||||
'(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength + ')');
|
||||
}
|
||||
this.writeOffset = writeIndex;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ class ByteBuffer {
|
||||
if (readIndex > this.writeOffset) {
|
||||
throw new Error('readIndex out of bounds exception: readOffset: ' + this.readOffset +
|
||||
', writeOffset: ' + this.writeOffset +
|
||||
'(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength) + ")";
|
||||
'(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength + ')');
|
||||
}
|
||||
this.readOffset = readIndex;
|
||||
}
|
||||
|
||||
@@ -83,26 +83,26 @@ class ByteBuffer {
|
||||
return this.writeOffset;
|
||||
}
|
||||
|
||||
setWriteOffset(writeOffset) {
|
||||
if (writeOffset > this.buffer.byteLength) {
|
||||
throw new Error('index out of bounds exception: readerIndex: ' + this.readOffset +
|
||||
', writerIndex: ' + this.writeOffset +
|
||||
'(expected: 0 <= readerIndex <= writerIndex <= capacity:' + this.buffer.byteLength);
|
||||
setWriteOffset(writeIndex) {
|
||||
if (writeIndex > this.buffer.byteLength) {
|
||||
throw new Error('writeIndex out of bounds exception: readOffset: ' + this.readOffset +
|
||||
', writeOffset: ' + this.writeOffset +
|
||||
'(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength + ')');
|
||||
}
|
||||
this.writeOffset = writeOffset;
|
||||
this.writeOffset = writeIndex;
|
||||
}
|
||||
|
||||
getReadOffset() {
|
||||
return this.readOffset;
|
||||
}
|
||||
|
||||
setReadOffset(readOffset) {
|
||||
if (readOffset > this.writeOffset) {
|
||||
throw new Error('index out of bounds exception: readerIndex: ' + this.readOffset +
|
||||
', writerIndex: ' + this.writeOffset +
|
||||
'(expected: 0 <= readerIndex <= writerIndex <= capacity:' + this.buffer.byteLength);
|
||||
setReadOffset(readIndex) {
|
||||
if (readIndex > this.writeOffset) {
|
||||
throw new Error('readIndex out of bounds exception: readOffset: ' + this.readOffset +
|
||||
', writeOffset: ' + this.writeOffset +
|
||||
'(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength + ')');
|
||||
}
|
||||
this.readOffset = readOffset;
|
||||
this.readOffset = readIndex;
|
||||
}
|
||||
|
||||
getCapacity() {
|
||||
|
||||
Reference in new issue
Block a user