Skip to content

Commit

Permalink
test[java]: java protocol test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed Jul 16, 2024
1 parent 3e3c398 commit 424c336
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions protocol/src/main/resources/java/ByteBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public int getWriteOffset() {

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;
}
Expand All @@ -60,8 +60,8 @@ public int getReadOffset() {

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;
}
Expand Down

0 comments on commit 424c336

Please sign in to comment.