From 52691488ee0b95381c8a4d25a567c78b29c4b00e Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Thu, 27 Jun 2013 19:01:01 +0900 Subject: [PATCH] Update Javadoc of ByteBufProcessor and MessageListProcessor - in response to @shacharo's suggestion --- buffer/src/main/java/io/netty/buffer/ByteBufProcessor.java | 4 +++- .../src/main/java/io/netty/channel/MessageListProcessor.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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; }