docs: @Override
    public void getBytesToSendToPeer(ByteBuffer bytes) throws GeneralSecurityException {
      if (outputFrame == null) { // A null outputFrame indicates we haven't started the handshake.
        if (isClient) {
          outputFrame = handshaker.startClientHandshake();
        } else {
          // The server needs bytes to process before it can start the handshake.
          return;
        }
      }
      // Write as many bytes as we are able.
      ByteBuffer outputFrameAlias = outputFrame;
      if (outputFrame.remaining() > bytes.remaining()) {
        outputFrameAlias = outputFrame.duplicate();
        outputFrameAlias.limit(outputFrameAlias.position() + bytes.remaining());
      }
      bytes.put(outputFrameAlias);
      outputFrame.position(outputFrameAlias.position());
    }