[#3896] Unpooled.copiedBuffer(ByteBuffer) and copiedBuffer(ByteBuffer...) is not thread-safe.
[#3896] Unpooled.copiedBuffer(ByteBuffer) and copiedBuffer(ByteBuffer...) is not thread-safe.

Motivation:

As we modify the position of the passed in ByteBuffer's this methods are not thread-safe.

Modifications:

Duplicate the input ByteBuffers before copy the content to  byte[].

Result:

Unpooled.copiedBuffer(ByteBuffer) and copiedBuffer(ByteBuffer...) is now thread-safe.

chanakaudaya/netty,imangry/netty-zh,imangry/netty-zh,chanakaudaya/netty,chanakaudaya/netty,chanakaudaya/netty,imangry/netty-zh,yipen9/netty,yipen9/netty,imangry/netty-zh,yipen9/netty,yipen9/netty,chanakaudaya/netty,imangry/netty-zh