mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-03 07:13:51 +00:00
test[java]: java protocol test
This commit is contained in:
1 parent
3e3c398ed5
commit
424c336fe6
1 file changed
+4
-4
@@ -48,8 +48,8 @@ public class ByteBuffer {
|
||||
|
||||
public void setWriteOffset(int writeIndex) {
|
||||
if (writeIndex > buffer.length) {
|
||||
throw new RuntimeException("writeIndex[" + writeIndex + "] out of bounds exception: readerIndex: " + readOffset +
|
||||
", writerIndex: " + writeOffset + "(expected: 0 <= readerIndex <= writerIndex <= capacity:" + buffer.length);
|
||||
throw new RuntimeException("writeIndex[" + writeIndex + "] out of bounds exception: readOffset: " + readOffset +
|
||||
", writeOffset: " + writeOffset + "(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.length + ")");
|
||||
}
|
||||
writeOffset = writeIndex;
|
||||
}
|
||||
@@ -60,8 +60,8 @@ public class ByteBuffer {
|
||||
|
||||
public void setReadOffset(int readIndex) {
|
||||
if (readIndex > writeOffset) {
|
||||
throw new RuntimeException("readIndex[" + readIndex + "] out of bounds exception: readerIndex: " + readOffset +
|
||||
", writerIndex: " + writeOffset + "(expected: 0 <= readerIndex <= writerIndex <= capacity:" + buffer.length);
|
||||
throw new RuntimeException("readIndex[" + readIndex + "] out of bounds exception: readOffset: " + readOffset +
|
||||
", writeOffset: " + writeOffset + "(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.length + ")");
|
||||
}
|
||||
readOffset = readIndex;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user