diff --git a/buffer/src/main/java/io/netty/buffer/ByteBufProcessor.java b/buffer/src/main/java/io/netty/buffer/ByteBufProcessor.java index f93a952910..28877e584a 100644 --- a/buffer/src/main/java/io/netty/buffer/ByteBufProcessor.java +++ b/buffer/src/main/java/io/netty/buffer/ByteBufProcessor.java @@ -165,7 +165,9 @@ public interface ByteBufProcessor { /** * @return the number of elements processed. {@link ByteBuf#forEachByte(ByteBufProcessor)} will determine * the index of the next byte to be processed based on this value. Usually, an implementation will - * return {@code 1} to advance the index by {@code 1}. + * return {@code 1} to advance the index by {@code 1}. Note that returning a non-positive value is + * allowed where a negative value advances the index in the opposite direction and zero leaves the index + * as-is. */ int process(ByteBuf buf, int index, byte value) throws Exception; } diff --git a/transport/src/main/java/io/netty/channel/MessageListProcessor.java b/transport/src/main/java/io/netty/channel/MessageListProcessor.java index 37cd20d87a..11fe1fcf24 100644 --- a/transport/src/main/java/io/netty/channel/MessageListProcessor.java +++ b/transport/src/main/java/io/netty/channel/MessageListProcessor.java @@ -25,7 +25,9 @@ public interface MessageListProcessor { /** * @return the number of elements processed. {@link MessageList#forEach(MessageListProcessor)} will determine * the index of the next element to be processed based on this value. Usually, an implementation will - * return {@code 1} to advance the index by {@code 1}. + * return {@code 1} to advance the index by {@code 1}. Note that returning a non-positive value is + * allowed where a negative value advances the index in the opposite direction and zero leaves the index + * as-is. */ int process(MessageList messages, int index, T value) throws Exception; }