What’s the difference between ChannelBuffer.copy() and ChannelBuffer.duplicate()?
In Multiple handlers in netty I ended up coming across a problem that was fixed if I passed a copy of a ChannelBuffer or if I called duplicate on it, but I’m not sure which one should be used, and the javadoc doesn’t help to know which one I should be using.
copy()creates an entirely new buffer (byte-for-byte).duplicate()creates a buffer which shares the original buffer’s data, but with its own indexes.