private void enqueue(ByteBuffer src) { do { PooledByteBuffer buffer = exchange.getConnection().getByteBufferPool().allocate(); ByteBuffer dst = buffer.getBuffer(); copy(dst, src); dst.flip(); this.buffers.add(buffer); } while (src.remaining() > 0); }
@Override public void closePooledResource(Object pooled) { ((PooledByteBuffer) pooled).close(); }