1515 */
1616package io .netty .buffer .api ;
1717
18- import io .netty .buffer .api .ComponentProcessor .ReadableComponentProcessor ;
19- import io .netty .buffer .api .ComponentProcessor .WritableComponentProcessor ;
20- import io .netty .buffer .api .ComponentProcessor .ReadableComponent ;
21- import io .netty .buffer .api .ComponentProcessor .WritableComponent ;
22-
2318import java .nio .ByteBuffer ;
2419import java .nio .ByteOrder ;
2520
3025 *
3126 * <h3>Creating a buffer</h3>
3227 *
33- * Buffers are created by {@linkplain Allocator allocators}, and their {@code allocate} family of methods.
34- * A number of standard allocators exist, and ara available through static methods on the {@code Allocator} interface.
28+ * Buffers are created by {@linkplain BufferAllocator allocators}, and their {@code allocate} family of methods.
29+ * A number of standard allocators exist, and ara available through static methods on the {@code BufferAllocator}
30+ * interface.
3531 *
3632 * <h3>Life cycle and reference counting</h3>
3733 *
7066 * To send a buffer to another thread, the buffer must not have any outstanding borrows.
7167 * That is to say, all {@linkplain #acquire() acquires} must have been paired with a {@link #close()};
7268 * all {@linkplain #slice() slices} must have been closed.
73- * And if this buffer is a constituent of a {@linkplain Allocator #compose(Deref...) composite buffer},
69+ * And if this buffer is a constituent of a {@linkplain BufferAllocator #compose(Deref...) composite buffer},
7470 * then that composite buffer must be closed.
7571 * And if this buffer is itself a composite buffer, then it must own all of its constituent buffers.
7672 * The {@link #isOwned()} method can be used on any buffer to check if it can be sent or not.
106102 * </pre>
107103 *
108104 */
109- public interface Buf extends Rc <Buf >, BufAccessors {
105+ public interface Buffer extends Rc <Buffer >, BufferAccessors {
110106 /**
111107 * Change the default byte order of this buffer, and return this buffer.
112108 *
113109 * @param order The new default byte order, used by accessor methods that don't use an explicit byte order.
114110 * @return This buffer instance.
115111 */
116- Buf order (ByteOrder order );
112+ Buffer order (ByteOrder order );
117113
118114 /**
119115 * The default byte order of this buffer.
@@ -139,11 +135,11 @@ public interface Buf extends Rc<Buf>, BufAccessors {
139135 * Set the reader offset. Make the next read happen from the given offset into the buffer.
140136 *
141137 * @param offset The reader offset to set.
142- * @return This Buf .
138+ * @return This Buffer .
143139 * @throws IndexOutOfBoundsException if the specified {@code offset} is less than zero or greater than the current
144140 * {@link #writerOffset()}.
145141 */
146- Buf readerOffset (int offset );
142+ Buffer readerOffset (int offset );
147143
148144 /**
149145 * Get the current writer offset. The next write will happen at this byte offset into the byffer.
@@ -156,12 +152,12 @@ public interface Buf extends Rc<Buf>, BufAccessors {
156152 * Set the writer offset. Make the next write happen at the given offset.
157153 *
158154 * @param offset The writer offset to set.
159- * @return This Buf .
155+ * @return This Buffer .
160156 * @throws IndexOutOfBoundsException if the specified {@code offset} is less than the current
161157 * {@link #readerOffset()} or greater than {@link #capacity()}.
162158 * @throws IllegalStateException if this buffer is {@linkplain #readOnly() read-only}.
163159 */
164- Buf writerOffset (int offset );
160+ Buffer writerOffset (int offset );
165161
166162 /**
167163 * Returns the number of readable bytes which is equal to {@code (writerOffset() - readerOffset())}.
@@ -183,10 +179,10 @@ default int writableBytes() {
183179 * #writerOffset()} are not modified.
184180 *
185181 * @param value The byte value to write at every position in the buffer.
186- * @return This Buf .
182+ * @return This Buffer .
187183 * @throws IllegalStateException if this buffer is {@linkplain #readOnly() read-only}.
188184 */
189- Buf fill (byte value );
185+ Buffer fill (byte value );
190186
191187 /**
192188 * Give the native memory address backing this buffer, or return 0 if this buffer has no native memory address.
@@ -199,7 +195,7 @@ default int writableBytes() {
199195 *
200196 * @return this buffer.
201197 */
202- Buf readOnly (boolean readOnly );
198+ Buffer readOnly (boolean readOnly );
203199
204200 /**
205201 * Query if this buffer is read-only or not.
@@ -224,7 +220,7 @@ default int writableBytes() {
224220 * @return A new buffer instance, with independent {@link #readerOffset()} and {@link #writerOffset()},
225221 * that is a view of the readable region of this buffer.
226222 */
227- default Buf slice () {
223+ default Buffer slice () {
228224 return slice (readerOffset (), readableBytes ());
229225 }
230226
@@ -243,7 +239,7 @@ default Buf slice() {
243239 * @return A new buffer instance, with independent {@link #readerOffset()} and {@link #writerOffset()},
244240 * that is a view of the given region of this buffer.
245241 */
246- Buf slice (int offset , int length );
242+ Buffer slice (int offset , int length );
247243
248244 /**
249245 * Copies the given length of data from this buffer into the given destination array, beginning at the given source
@@ -303,13 +299,13 @@ default Buf slice() {
303299 * @throws IndexOutOfBoundsException if the source or destination positions, or the length, are negative,
304300 * or if the resulting end positions reaches beyond the end of either this buffer or the destination array.
305301 */
306- void copyInto (int srcPos , Buf dest , int destPos , int length );
302+ void copyInto (int srcPos , Buffer dest , int destPos , int length );
307303
308304 /**
309305 * Resets the {@linkplain #readerOffset() read offset} and the {@linkplain #writerOffset() write offset} on this
310306 * buffer to their initial values.
311307 */
312- default Buf reset () {
308+ default Buffer reset () {
313309 readerOffset (0 );
314310 writerOffset (0 );
315311 return this ;
@@ -386,8 +382,8 @@ default ByteCursor openReverseCursor() {
386382 * bytes.
387383 * The buffer must be in {@linkplain #isOwned() an owned state}, or an exception will be thrown.
388384 * If this buffer already has the necessary space, then this method returns immediately.
389- * If this buffer does not already have the necessary space, then it will be expanded using the {@link Allocator}
390- * the buffer was created with.
385+ * If this buffer does not already have the necessary space, then it will be expanded using the
386+ * {@link BufferAllocator} the buffer was created with.
391387 * This method is the same as calling {@link #ensureWritable(int, boolean)} where {@code allowCompaction} is
392388 * {@code false}.
393389 *
@@ -418,8 +414,8 @@ default void ensureWritable(int size) {
418414 * </li>
419415 * <li>
420416 * Regardless of the value of the {@code allowCompaction}, the implementation may make more space available
421- * by just allocating more or larger buffers. This allocation would use the same {@link Allocator} that this
422- * buffer was created with.
417+ * by just allocating more or larger buffers. This allocation would use the same {@link BufferAllocator}
418+ * that this buffer was created with.
423419 * </li>
424420 * <li>
425421 * If {@code allowCompaction} is {@code true}, then the implementation may choose to do a combination of
@@ -480,7 +476,7 @@ default void ensureWritable(int size) {
480476 *
481477 * @return A new buffer with independent and exclusive ownership over the read and readable bytes from this buffer.
482478 */
483- Buf bifurcate ();
479+ Buffer bifurcate ();
484480
485481 /**
486482 * Discards the read bytes, and moves the buffer contents to the beginning of the buffer.
0 commit comments