Set stream writers

@param AbstractStreamWriter[] $writers

@return $this
346534
public function setStreamWriters(array $writers)
    {
        foreach ($writers as $key => $writer) {
            $this->setStreamWriter($key, $writer);
        }

        return $this;
    }
85763
public function setLibraries(array $libraries)
    {
        foreach ($libraries as $library) {
            $library->setParser($this);
            $library->setStream($this->stream);
            $this->tags = array_merge($this->tags, $library->getTags());
        }
        return $this;
    }
1204581
public function setQueues($queues)
    {
        if ($this->status != self::STATUS_NEW) {
            throw new \RuntimeException('Cannot set worker queues after worker has started working');
        }

        $this->queues = $queues;
    }
114436
public function xmlSerialize(Xml\Writer $writer)
    {
        $propertiesByGroup = [];

        foreach ($this->children() as $property) {
            $group = $property->group;

            if (!isset($propertiesByGroup[$group])) {
                $propertiesByGroup[$group] = [];
            }

            $propertiesByGroup[$group][] = $property;
        }

        $writer->startElement(strtolower($this->name));

        foreach ($propertiesByGroup as $group => $properties) {
            if (!empty($group)) {
                $writer->startElement('group');
                $writer->writeAttribute('name', strtolower($group));
            }

            foreach ($properties as $property) {
                switch ($property->name) {
                    case 'VERSION':
                        break;

                    case 'XML':
                        $value = $property->getParts();
                        $fragment = new Xml\Element\XmlFragment($value[0]);
                        $writer->write($fragment);
                        break;

                    default:
                        $property->xmlSerialize($writer);
                        break;
                }
            }

            if (!empty($group)) {
                $writer->endElement();
            }
        }

        $writer->endElement();
    }
1139681
public function setJournals(array $journals = [])
    {
        $this->journals = [];
        foreach ($journals as $journal) {
            $this->addJournal($journal);
        }

        return $this;
    }
1319776
private function streamsOf(array $workers): array
    {
        $streams = [];
        foreach (array_keys($workers) as $index) {
            $streams[$index] = $this->streams[$index];
        }

        return $streams;
    }
418230
private function setWriter($writer = null)
    {
        if ($writer === null) {
            $writer = function ($string) {
                print $string;
            };
        }

        if (!is_callable($writer)) {
            throw new \InvalidArgumentException(
                'Writer must be callable'
            );
        }

        $this->writer = $writer;
    }
1086118
public function writeUtf($stream)
    {
        $this->writeInt(strlen($stream));
        $this->_stream.= $stream;
        return $this;
    }
327882
public function setFileFormats(array $formats)
    {
        $this->file_formats = array();
        foreach ($formats as $mime => $writer)
            $this->addFileFormat($mime, $writer);

        return $this;
    }
396811
final public function setOutputWriter(OutputWriter $outputWriter)
    {
        if ($outputWriter !== $this->outputWriter) {
            $this->outputWriter = $outputWriter;
            $this->consumer = null;
        }
        
        return $this;
    }
102323
protected function setStream(IStream $stream)
    {
        if ($stream->isOpen() === false) {
            $msg = "An AbstractStreamAccess do not accept closed streams to be read.";
            throw new StreamAccessException($msg, $this, StreamAccessException::NOT_OPEN);
        }

        $this->stream = $stream;
    }
47448
private function add(Writer $writer, array $properties)
    {
        foreach ($properties as $property) {
            if (! is_null($this->$property)) {
                $writer->write([$property => $this->$property]);
            }
        }
    }
652769
public function createStreamedResponse(WriterInterface $writer, $status = 200, $headers = array())
    {
        return new StreamedResponse(
            function () use ($writer) {
                $writer->save('php://output');
            },
            $status,
            $headers
        );
    }
1114652
public function setOutputStream($level, $stream)
    {
        if (static::$streamsMap === null) {
            $this->resetOutputStreams();
        }
        $this->checkLevel($level);
        if (!is_resource($stream)) {
            throw new \UnexpectedValueException("Argument '\$stream' must be a writable stream resource");
        }
        static::$streamsMap[$level] = $stream;
        return $this;
    }
1030214
public function write(WriterInterface $writer)
    {
        foreach ($this->childs as $schema) {
            $schema->write($writer);
        }

        return $this;
    }
669312
protected function writeRow(array $columns)
    {
        $this->getStream()->write($this->buildRow($columns));
        $this->lines++;

        return $this;
    }
641234
public function set(array $files)
    {
        if (!empty($files)) {
            foreach ($files as $_file) {
                $this->add($_file);
            }
        }
        return $this;
    }