protected boolean flush(ByteBuffer buf) throws IOException {
        int remaining = buf.remaining();
        if (remaining > 0) {
            int written = socketChannel.write(buf);
            return written >= remaining;
        }
        return true;
    }
Flushes the buffer to the network, non blocking.
Visible for testing.
@param buf ByteBuffer
@return boolean true if the buffer has been emptied out, false otherwise
@throws IOException
clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java