mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-12 20:16:07 +00:00
ref[JS]: js protocol
This commit is contained in:
1 parent
27943482c1
commit
b160d13129
2 files changed
+24
-24
No files matched your search
@@ -96,26 +96,26 @@ const ByteBuffer = function() {
|
||||
return this.writeOffset;
|
||||
}
|
||||
|
||||
this.setWriteOffset = function(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);
|
||||
this.setWriteOffset = function(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;
|
||||
};
|
||||
|
||||
this.getReadOffset = function() {
|
||||
return this.readOffset;
|
||||
}
|
||||
|
||||
this.setReadOffset = function(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);
|
||||
this.setReadOffset = function(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;
|
||||
};
|
||||
|
||||
this.getCapacity = function() {
|
||||
|
||||
@@ -96,26 +96,26 @@ const ByteBuffer = function() {
|
||||
return this.writeOffset;
|
||||
}
|
||||
|
||||
this.setWriteOffset = function(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);
|
||||
this.setWriteOffset = function(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;
|
||||
};
|
||||
|
||||
this.getReadOffset = function() {
|
||||
return this.readOffset;
|
||||
}
|
||||
|
||||
this.setReadOffset = function(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);
|
||||
this.setReadOffset = function(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;
|
||||
};
|
||||
|
||||
this.getCapacity = function() {
|
||||
|
||||
Reference in new issue
Block a user