diff --git a/buffer/src/main/java/io/netty/buffer/ByteBuf.java b/buffer/src/main/java/io/netty/buffer/ByteBuf.java index 25afdf1f8e..a1a7753826 100644 --- a/buffer/src/main/java/io/netty/buffer/ByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/ByteBuf.java @@ -2015,11 +2015,14 @@ public abstract class ByteBuf implements ReferenceCounted, Comparable { /** * Locates the first occurrence of the specified {@code value} in this - * buffer. The search takes place from the specified {@code fromIndex} - * (inclusive) to the specified {@code toIndex} (exclusive). + * buffer. The search takes place from the specified {@code fromIndex} + * (inclusive) to the specified {@code toIndex} (exclusive). *

* If {@code fromIndex} is greater than {@code toIndex}, the search is - * performed in a reversed order. + * performed in a reversed order from {@code fromIndex} (exclusive) + * down to {@code toIndex} (inclusive). + *

+ * Note that the lower index is always included and higher always excluded. *

* This method does not modify {@code readerIndex} or {@code writerIndex} of * this buffer.