diff --git a/protocol/src/main/resources/kotlin/ByteBuffer.kt b/protocol/src/main/resources/kotlin/ByteBuffer.kt index 4ca31c889..2cd64fc12 100644 --- a/protocol/src/main/resources/kotlin/ByteBuffer.kt +++ b/protocol/src/main/resources/kotlin/ByteBuffer.kt @@ -40,8 +40,8 @@ class ByteBuffer { fun setWriteOffset(writeIndex: Int) { if (writeIndex > buffer.size) { throw RuntimeException( - "writeIndex[" + writeIndex + "] out of bounds exception: readerIndex: " + readOffset + - ", writerIndex: " + writeOffset + "(expected: 0 <= readerIndex <= writerIndex <= capacity:" + buffer.size + "writeIndex[" + writeIndex + "] out of bounds exception: readOffset: " + readOffset + + ", writeOffset: " + writeOffset + "(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.size + ")" ) } writeOffset = writeIndex @@ -54,8 +54,8 @@ class ByteBuffer { fun setReadOffset(readIndex: Int) { if (readIndex > writeOffset) { throw RuntimeException( - "readIndex[" + readIndex + "] out of bounds exception: readerIndex: " + readOffset + - ", writerIndex: " + writeOffset + "(expected: 0 <= readerIndex <= writerIndex <= capacity:" + buffer.size + "readIndex[" + readIndex + "] out of bounds exception: readOffset: " + readOffset + + ", writeOffset: " + writeOffset + "(expected: 0 <= readOffsetIndex <= writeOffset <= capacity:" + buffer.size + ")" ) } readOffset = readIndex diff --git a/protocol/src/test/kotlin/com/zfoo/kotlin/ByteBuffer.kt b/protocol/src/test/kotlin/com/zfoo/kotlin/ByteBuffer.kt index 53866f5dc..c7917c54b 100644 --- a/protocol/src/test/kotlin/com/zfoo/kotlin/ByteBuffer.kt +++ b/protocol/src/test/kotlin/com/zfoo/kotlin/ByteBuffer.kt @@ -40,8 +40,8 @@ class ByteBuffer { fun setWriteOffset(writeIndex: Int) { if (writeIndex > buffer.size) { throw RuntimeException( - "writeIndex[" + writeIndex + "] out of bounds exception: readerIndex: " + readOffset + - ", writerIndex: " + writeOffset + "(expected: 0 <= readerIndex <= writerIndex <= capacity:" + buffer.size + "writeIndex[" + writeIndex + "] out of bounds exception: readOffset: " + readOffset + + ", writeOffset: " + writeOffset + "(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.size + ")" ) } writeOffset = writeIndex @@ -54,8 +54,8 @@ class ByteBuffer { fun setReadOffset(readIndex: Int) { if (readIndex > writeOffset) { throw RuntimeException( - "readIndex[" + readIndex + "] out of bounds exception: readerIndex: " + readOffset + - ", writerIndex: " + writeOffset + "(expected: 0 <= readerIndex <= writerIndex <= capacity:" + buffer.size + "readIndex[" + readIndex + "] out of bounds exception: readOffset: " + readOffset + + ", writeOffset: " + writeOffset + "(expected: 0 <= readOffsetIndex <= writeOffset <= capacity:" + buffer.size + ")" ) } readOffset = readIndex