docs: private void sendHandshake(ChannelHandlerContext ctx) {
      boolean needToFlush = false;
  
      // Iterate until there is nothing left to write.
      while (true) {
        buffer = getOrCreateBuffer(ctx.alloc());
        try {
          handshaker.getBytesToSendToPeer(buffer);
        } catch (GeneralSecurityException e) {
          throw new RuntimeException(e);
        }
        if (!buffer.isReadable()) {
          break;
        }
  
        needToFlush = true;
        @SuppressWarnings("unused") // go/futurereturn-lsc
        Future<?> possiblyIgnoredError = ctx.write(buffer);
        buffer = null;
      }
  
      // If something was written, flush.
      if (needToFlush) {
        ctx.flush();
      }
    }