code: public static void handleDomainOperationResponseStreams(final OperationContext context,
                                                              final ModelNode responseNode,
                                                              final List<OperationResponse.StreamEntry> streams) {
  
          if (responseNode.hasDefined(RESPONSE_HEADERS)) {
              ModelNode responseHeaders = responseNode.get(RESPONSE_HEADERS);
              // Strip out any stream header as the header created by this process is what counts
              responseHeaders.remove(ATTACHED_STREAMS);
              if (responseHeaders.asInt() == 0) {
                  responseNode.remove(RESPONSE_HEADERS);
              }
          }
  
          for (OperationResponse.StreamEntry streamEntry : streams) {
              context.attachResultStream(streamEntry.getUUID(), streamEntry.getMimeType(), streamEntry.getStream());
          }
      }
docs: Deal with streams attached to an operation response from a proxied domain process.
  
  @param context the context of the operation
  @param responseNode the DMR response from the proxied process
  @param streams the streams associated with the response