private boolean flush(ByteBuffer buf) throws IOException {
    int remaining = buf.remaining();
    if (remaining > 0) {
      long startNs = SystemTime.getInstance().nanoseconds();
      int written = socketChannel.write(buf);
      logger.trace("Flushed {} bytes in {} ns", written, SystemTime.getInstance().nanoseconds() - startNs);
      return written >= remaining;
    }
    return true;
  }
Flushes the buffer to the network
@param buf ByteBuffer
@return boolean true if the buffer has been emptied out, false otherwise
@throws IOException
ambry-network/src/main/java/com/github/ambry/network/SSLTransmission.java