From d2f1c85f24c5114e9ee8a7914fb9dbe667ec1dea Mon Sep 17 00:00:00 2001 From: Cruz Julian Bishop Date: Thu, 28 Jun 2012 19:33:54 +1000 Subject: [PATCH] Documentation and checkstyle fixes from @fredericBregier This is part of #414 --- .../io/netty/buffer/CompositeByteBuf.java | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java b/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java index 1977e9d574..7a7990aa35 100644 --- a/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java @@ -574,35 +574,33 @@ public class CompositeByteBuf extends AbstractByteBuf { dst.writerIndex(dst.capacity()); } - + /** - * Gets the {@link ByteBuf} used at the specified index. + * Gets the {@link ByteBuf} portion of this {@link CompositeByteBuf} that + * contains the specified {@code index}. This is an expert method! + * *

* Please note that since a {@link CompositeByteBuf} is made up of * multiple {@link ByteBuf}s, this does not return the full buffer. * Instead, it only returns a portion of the composite buffer where the * index is located *

- * - *

- * This is a method meant for use by experts - Please be careful - * when using it. - *

- * - * @param index The index to use - * @return The {@link ByteBuf} used at the indes. - * @throws IndexOutOfBoundsException + * + * @param index The {@code index} to search for and include in the returned {@link ByteBuf} + * @return The {@link ByteBuf} that contains the specified {@code index} + * @throws IndexOutOfBoundsException when the specified {@code index} is less than + * zero, or larger than {@code capacity()} */ public ByteBuf getBufferFor(int index) throws IndexOutOfBoundsException { if (index < 0 || index > capacity()) { throw new IndexOutOfBoundsException("Invalid index: " + index - + " - Bytes needed: " + (index) + ", maximum is " + + " - Bytes needed: " + index + ", maximum is " + capacity()); } //Return the component byte buffer return components[componentId(index)]; - + } @Override