Class ByteBufUtil


  • public final class ByteBufUtil
    extends Object
    Utility class for operations on ByteBufs.
    • Method Detail

      • prepend

        public static io.netty.buffer.CompositeByteBuf prepend​(io.netty.buffer.ByteBuf byteBuf,
                                                               io.netty.buffer.ByteBuf... elements)
        Prepends the given elements at the start of the byteBuf and moves all readable bytes accordingly.

        Note: ReferenceCounted.release() ownership of all ByteBuf objects in elements is transferred to this CompositeByteBuf.

        Parameters:
        byteBuf - the byteBuf to append the elements
        elements - the elements to append
        Returns:
        the composed ByteBuf