Documentation and checkstyle fixes from @fredericBregier
This is part of #414
This commit is contained in:
parent
a92ed57b18
commit
d2f1c85f24
@ -574,35 +574,33 @@ public class CompositeByteBuf extends AbstractByteBuf {
|
|||||||
|
|
||||||
dst.writerIndex(dst.capacity());
|
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!
|
||||||
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* Please note that since a {@link CompositeByteBuf} is made up of
|
* Please note that since a {@link CompositeByteBuf} is made up of
|
||||||
* multiple {@link ByteBuf}s, this does <em>not</em> return the full buffer.
|
* multiple {@link ByteBuf}s, this does <em>not</em> return the full buffer.
|
||||||
* Instead, it only returns a portion of the composite buffer where the
|
* Instead, it only returns a portion of the composite buffer where the
|
||||||
* index is located
|
* index is located
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* <p>
|
* @param index The {@code index} to search for and include in the returned {@link ByteBuf}
|
||||||
* This is a method meant for use by <em>experts</em> - Please be careful
|
* @return The {@link ByteBuf} that contains the specified {@code index}
|
||||||
* when using it.
|
* @throws IndexOutOfBoundsException when the specified {@code index} is less than
|
||||||
* </p>
|
* zero, or larger than {@code capacity()}
|
||||||
*
|
|
||||||
* @param index The index to use
|
|
||||||
* @return The {@link ByteBuf} used at the indes.
|
|
||||||
* @throws IndexOutOfBoundsException
|
|
||||||
*/
|
*/
|
||||||
public ByteBuf getBufferFor(int index) throws IndexOutOfBoundsException {
|
public ByteBuf getBufferFor(int index) throws IndexOutOfBoundsException {
|
||||||
if (index < 0 || index > capacity()) {
|
if (index < 0 || index > capacity()) {
|
||||||
throw new IndexOutOfBoundsException("Invalid index: " + index
|
throw new IndexOutOfBoundsException("Invalid index: " + index
|
||||||
+ " - Bytes needed: " + (index) + ", maximum is "
|
+ " - Bytes needed: " + index + ", maximum is "
|
||||||
+ capacity());
|
+ capacity());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Return the component byte buffer
|
//Return the component byte buffer
|
||||||
return components[componentId(index)];
|
return components[componentId(index)];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user