diff --git a/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java b/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java index 944ad434a4..095e534110 100644 --- a/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java @@ -37,7 +37,7 @@ import java.util.ListIterator; * {@link ByteBufAllocator#compositeBuffer()} or {@link Unpooled#wrappedBuffer(ByteBuf...)} instead of calling the * constructor explicitly. */ -public class CompositeByteBuf extends AbstractReferenceCountedByteBuf { +public class CompositeByteBuf extends AbstractReferenceCountedByteBuf implements Iterable { private static final ByteBuffer EMPTY_NIO_BUFFER = Unpooled.EMPTY_BUFFER.nioBuffer(); @@ -371,6 +371,7 @@ public class CompositeByteBuf extends AbstractReferenceCountedByteBuf { return this; } + @Override public Iterator iterator() { ensureAccessible(); List list = new ArrayList(components.size());