test[java]: java protocol test

This commit is contained in:
godotg committed 2024-07-16 15:10:13 +08:00
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;
}