copy

static PacketByteBuf copy(ByteBuf buf)

Wraps the newly created buf from {@code buf.copy} in a packet byte buf.

Return

a copy of the buf

See also

io.netty.buffer.ByteBuf

ByteBuf#copy()

Parameters

buf

the original buf

static PacketByteBuf copy(ByteBuf buf, int index, int length)

Wraps the newly created buf from {@code buf.copy} in a packet byte buf.

Return

a copy of the buf

See also

io.netty.buffer.ByteBuf

ByteBuf#copy(int, int)

Parameters

buf

the original buf

index

the starting index

length

the size of the copy