We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccb65f3 commit 2436e1fCopy full SHA for 2436e1f
src/main/java/io/appulse/utils/BytesReadOnly.java
@@ -230,6 +230,13 @@ public int readerIndex () {
230
231
@Override
232
public Bytes readerIndex (int newIndex) {
233
+ if (newIndex < 0 || newIndex > writerIndex()) {
234
+ val msg = String.format(
235
+ "Reader index error: newIndex(%d) < 0 || newIndex(%d) > writerIndex(%d)",
236
+ newIndex, newIndex, writerIndex()
237
+ );
238
+ throw new IndexOutOfBoundsException(msg);
239
+ }
240
readerIndex = newIndex;
241
return this;
242
}
0 commit comments