diff --git a/protocol/src/main/resources/csharp/Buffer/ByteBuffer.cs b/protocol/src/main/resources/csharp/Buffer/ByteBuffer.cs index 3234a786e..a231ada00 100644 --- a/protocol/src/main/resources/csharp/Buffer/ByteBuffer.cs +++ b/protocol/src/main/resources/csharp/Buffer/ByteBuffer.cs @@ -89,12 +89,11 @@ public void SetWriteOffset(int writeIndex) { if (writeIndex > buffer.Length) { - throw new Exception("writeIndex[" + writeIndex + "] out of bounds exception: readerIndex: " + + throw new Exception("writeIndex[" + writeIndex + "] out of bounds exception: readOffset: " + readOffset + - ", writerIndex: " + writeOffset + - "(expected: 0 <= readerIndex <= writerIndex <= capacity:" + buffer.Length); + ", writeOffset: " + writeOffset + + "(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.Length); } - writeOffset = writeIndex; } @@ -107,11 +106,10 @@ public void SetReadOffset(int readIndex) { if (readIndex > writeOffset) { - throw new Exception("readIndex[" + readIndex + "] out of bounds exception: readerIndex: " + readOffset + - ", writerIndex: " + writeOffset + - "(expected: 0 <= readerIndex <= writerIndex <= capacity:" + buffer.Length); + throw new Exception("readIndex[" + readIndex + "] out of bounds exception: readIndex: " + readOffset + + ", writeOffset: " + writeOffset + + "(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.Length); } - readOffset = readIndex; } diff --git a/protocol/src/test/csharp/zfoocs/Buffer/ByteBuffer.cs b/protocol/src/test/csharp/zfoocs/Buffer/ByteBuffer.cs index 3234a786e..a231ada00 100644 --- a/protocol/src/test/csharp/zfoocs/Buffer/ByteBuffer.cs +++ b/protocol/src/test/csharp/zfoocs/Buffer/ByteBuffer.cs @@ -89,12 +89,11 @@ public void SetWriteOffset(int writeIndex) { if (writeIndex > buffer.Length) { - throw new Exception("writeIndex[" + writeIndex + "] out of bounds exception: readerIndex: " + + throw new Exception("writeIndex[" + writeIndex + "] out of bounds exception: readOffset: " + readOffset + - ", writerIndex: " + writeOffset + - "(expected: 0 <= readerIndex <= writerIndex <= capacity:" + buffer.Length); + ", writeOffset: " + writeOffset + + "(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.Length); } - writeOffset = writeIndex; } @@ -107,11 +106,10 @@ public void SetReadOffset(int readIndex) { if (readIndex > writeOffset) { - throw new Exception("readIndex[" + readIndex + "] out of bounds exception: readerIndex: " + readOffset + - ", writerIndex: " + writeOffset + - "(expected: 0 <= readerIndex <= writerIndex <= capacity:" + buffer.Length); + throw new Exception("readIndex[" + readIndex + "] out of bounds exception: readIndex: " + readOffset + + ", writeOffset: " + writeOffset + + "(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.Length); } - readOffset = readIndex; }