def build_association_accept(info)
      # Big endian encoding:
      @outgoing.endian = @net_endian
      # Clear the outgoing binary string:
      @outgoing.reset
      # No abstract syntax in association response. To make this work with the method that
      # encodes the presentation context, we pass on a one-element array containing nil).
      abstract_syntaxes = Array.new(1, nil)
      # Note: The order of which these components are built is not arbitrary.
      append_application_context
      # Reset the presentation context instance variable:
      @presentation_contexts = Hash.new
      # Create the presentation context hash object that will be passed to the builder method:
      p_contexts = Hash.new
      # Build the presentation context strings, one by one:
      info[:pc].each do |pc|
        @presentation_contexts[pc[:presentation_context_id]] = pc[:selected_transfer_syntax]
        # Add the information from this pc item to the p_contexts hash:
        p_contexts[pc[:abstract_syntax]] = Hash.new unless p_contexts[pc[:abstract_syntax]]
        transfer_syntaxes = pc[:selected_transfer_syntax].nil? ? [] : [ pc[:selected_transfer_syntax] ]
        p_contexts[pc[:abstract_syntax]][pc[:presentation_context_id]] = {:transfer_syntaxes => transfer_syntaxes, :result => pc[:result]}
      end
      append_presentation_contexts(p_contexts, ITEM_PRESENTATION_CONTEXT_RESPONSE)
      append_user_information(@user_information)
      # Header must be built last, because we need to know the length of the other components.
      append_association_header(PDU_ASSOCIATION_ACCEPT, info[:called_ae])
    end
def build_association_accept(info)
      # Big endian encoding:
      @outgoing.endian = @net_endian
      # Clear the outgoing binary string:
      @outgoing.reset
      # No abstract syntax in association response. To make this work with the method that
      # encodes the presentation context, we pass on a one-element array containing nil).
      abstract_syntaxes = Array.new(1, nil)
      # Note: The order of which these components are built is not arbitrary.
      append_application_context
      # Reset the presentation context instance variable:
      @presentation_contexts = Hash.new
      # Create the presentation context hash object that will be passed to the builder method:
      p_contexts = Hash.new
      # Build the presentation context strings, one by one:
      info[:pc].each do |pc|
        @presentation_contexts[pc[:presentation_context_id]] = pc[:selected_transfer_syntax]
        # Add the information from this pc item to the p_contexts hash:
        p_contexts[pc[:abstract_syntax]] = Hash.new unless p_contexts[pc[:abstract_syntax]]
        transfer_syntaxes = pc[:selected_transfer_syntax].nil? ? [] : [ pc[:selected_transfer_syntax] ]
        p_contexts[pc[:abstract_syntax]][pc[:presentation_context_id]] = {:transfer_syntaxes => transfer_syntaxes, :result => pc[:result]}
      end
      append_presentation_contexts(p_contexts, ITEM_PRESENTATION_CONTEXT_RESPONSE)
      append_user_information(@user_information)
      # Header must be built last, because we need to know the length of the other components.
      append_association_header(PDU_ASSOCIATION_ACCEPT, info[:called_ae])
    end
Builds the binary string which is sent as the association accept (in response to an association request).

 === Parameters

 * <tt>info</tt> -- The association information hash.