Returns a retained buffer which shares the whole region of this buffer.
Modifying the content of the returned buffer or this buffer affects
each other's content while they maintain separate indexes and marks.
This method is identical to {@code buf.slice(0, buf.capacity())}.
This method does not modify {@code readerIndex} or {@code writerIndex} of
this buffer.
<p>
Note that this method returns a {@linkplain #retain() retained} buffer unlike {@link #slice(int, int)}.
This method behaves similarly to {@code duplicate().retain()} except that this method may return
a buffer implementation that produces less garbage.
Returns a retained buffer which shares the whole region of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method is identical to {@code buf.slice(0, buf.capacity())}. This method does not modify {@code readerIndex} or {@code writerIndex} of this buffer. <p> Note that this method returns a {@linkplain #retain() retained} buffer unlike {@link #slice(int, int)}. This method behaves similarly to {@code duplicate().retain()} except that this method may return a buffer implementation that produces less garbage.