Package org.drasyl.util
Class ByteBufUtil
- java.lang.Object
-
- org.drasyl.util.ByteBufUtil
-
public final class ByteBufUtil extends Object
Utility class for operations onByteBuf
s.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.netty.buffer.CompositeByteBuf
prepend(io.netty.buffer.ByteBuf byteBuf, io.netty.buffer.ByteBuf... elements)
Prepends the givenelements
at the start of thebyteBuf
and moves all readable bytes accordingly.
-
-
-
Method Detail
-
prepend
public static io.netty.buffer.CompositeByteBuf prepend(io.netty.buffer.ByteBuf byteBuf, io.netty.buffer.ByteBuf... elements)
Prepends the givenelements
at the start of thebyteBuf
and moves all readable bytes accordingly.Note:
ReferenceCounted.release()
ownership of allByteBuf
objects inelements
is transferred to thisCompositeByteBuf
.- Parameters:
byteBuf
- the byteBuf to append the elementselements
- the elements to append- Returns:
- the composed
ByteBuf
-
-