From looking at the source it seems that the WebSockets.sendBinary methods that take ByteBuffer will take ownership of the buffer, meaning I shouldn't modify (or return it to a pool) after I pass it to these methods. Is this correct?

Looking at sendInternal, the buffer passed is then wrapped in a dummy ImmediatePooledByteBuffer. I could make alternative versions of these sendBinary methods that take PooledByteBuffer. Allowing me to use pooled buffers.

Since this functionality is missing it makes me think that there may be a reason why it shouldn't be done.