Send all buffered messages to another OutputWriter.
Be aware that messages are removed during this process.

@param OutputWriter $outputWriter
@throws UnexpectedValueException
@throws LogicException
@return void
484392
public function flushTo(OutputWriter $outputWriter)
    {
        if ($outputWriter === $this) {
            throw new LogicException('Operation not allowed');
        }
    
        $minLevel = $outputWriter->getLevel();
        
        while (!empty($this->buffer)) {
            $item = array_shift($this->buffer);
    
            if ($item['level'] < $minLevel) {
                continue;
            }
            
            switch ($item['level']) {
                case OutputLevel::ERROR:
                    $outputWriter->error($item['message'], $item['newLine']);
                break;
                case OutputLevel::NORMAL:
                    $outputWriter->normal($item['message'], $item['newLine']);
                break;
                case OutputLevel::VERBOSE:
                    $outputWriter->verbose($item['message'], $item['newLine']);
                break;
                case OutputLevel::VERY_VERBOSE:
                    $outputWriter->veryVerb($item['message'], $item['newLine']);
                break;
                case OutputLevel::DEBUG:
                    $outputWriter->debug($item['message'], $item['newLine']);
                break;
                default:
                    throw new UnexpectedValueException('Unexpected value of level');
            }
        }
    }
28926
public function write($messages, $append = false)
    {
        $file = $this->getOutputPath().DIRECTORY_SEPARATOR.$this->filename;

        if ($append) {
            file_put_contents($file, $messages, FILE_APPEND);
        } else {
            file_put_contents($file, $messages);
        }
    }
868758
public void writeMessageSetTo(final CodedOutputStream output)
                                throws IOException {
    for (int i = 0; i < fields.getNumArrayEntries(); i++) {
      writeMessageSetTo(fields.getArrayEntryAt(i), output);
    }
    for (final Map.Entry<FieldDescriptorType, Object> entry :
             fields.getOverflowEntries()) {
      writeMessageSetTo(entry, output);
    }
  }
659797
@Override
    public void setOutputInvoker(final OutputInvoker outputInvoker) {
        this.outputInvoker = outputInvoker;

        if (concurrency > 1)
            outputInvoker.setOutputConcurrency(concurrency);
    }
355294
public function sendOutput(String $output, String $colour='white', String $backgroundColor='black')
	{
		fwrite(STDOUT, $this->getText($output, $colour, $backgroundColor));
	}
1171711
@Override
    public void write(int value) throws IOException {
        validate();
        byte[] buf = new byte[1];
        buf[0] = (byte) value;
        writeToBuffers(buf, 0, 1);

    }
676970
public void write(final Writer outputWriter) throws IOException {
    try (final DataInputStream keyStream = entry.getKeyStream();
         final DataInputStream valueStream = entry.getValueStream();) {
      outputWriter.write("Container: ");
      outputWriter.write(keyStream.readUTF());
      outputWriter.write("\n");
      this.writeFiles(valueStream, outputWriter);
    }
  }
165505
public function exec($output)
    {
        $this->writer->open($output);
        foreach ($this->models as $model) {
            if ($this->filter === false || $this->filter->filter($model)) {
                $this->writer->write($model, $this->associations);
            }
        }
        $this->writer->close();
    }
300747
public static <T> void writeTo(OutputStream out, T message, Schema<T> schema, boolean numeric,
            LinkedBuffer buffer) throws IOException
    {
        if (buffer.start != buffer.offset)
        {
            throw new IllegalArgumentException("Buffer previously used and had not been reset.");
        }

        MsgpackXOutput output = new MsgpackXOutput(buffer, numeric, schema);

        LinkedBuffer objectHeader = output.writeStartObject();
        schema.writeTo(output, message);

        if (output.isLastRepeated())
        {
            output.writeEndArray();
        }

        output.writeEndObject(objectHeader);

        LinkedBuffer.writeTo(out, buffer);
    }
1368019
public void write(Writer out)
         throws IOException
    {
        out.write("<!--\n");
        super.write(out);
        out.write("\n-->");
    }
599375
public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL) {
        $this->handle->write($messages, $newline, $type);
    }
1356773
public function onAfterWrite()
    {
        parent::onAfterWrite();

        // Deal with sending the status emails
        if ($this->isChanged('Status')) {
            $notifications = Notification::get()
                ->filter("Status", $this->Status);
                
            // Loop through available notifications and send
            foreach ($notifications as $notification) {
                $notification->sendNotification($this);
            }
        }
    }
702215
private function connectOutputToEvents(OutputInterface $output)
    {
        $this->getHelper('phpdocumentor_logger')->connectOutputToLogging($output, $this);

        Dispatcher::getInstance()->addListener(
            Transformer::EVENT_PRE_TRANSFORM,
            function (PreTransformEvent $event) use ($output) {
                $transformations = $event->getSubject()->getTemplates()->getTransformations();
                $output->writeln(sprintf("\nApplying %d transformations", count($transformations)));
            }
        );
        Dispatcher::getInstance()->addListener(
            Transformer::EVENT_PRE_INITIALIZATION,
            function (WriterInitializationEvent $event) use ($output) {
                $output->writeln('  Initialize writer "' . get_class($event->getWriter()) . '"');
            }
        );
        Dispatcher::getInstance()->addListener(
            Transformer::EVENT_PRE_TRANSFORMATION,
            function (PreTransformationEvent $event) use ($output) {
                $output->writeln(
                    '  Execute transformation using writer "' . $event->getTransformation()->getWriter() . '"'
                );
            }
        );
    }
1106752
protected function writeln($messages, $verbosity = OutputInterface::VERBOSITY_NORMAL)
    {
        $this->write($messages, true, $verbosity);
    }
863702
public void writeTo(OutputStream out) throws IOException {
        if (!(out instanceof DataOutput)) {
            out = new DataOutputStream(out);
        }

        writeTo((DataOutput)out);

        out.flush();
    }
746903
public function execute(InputInterface $input, OutputInterface $output)
    {
        if (! $this->emailSender) {
            throw new LogicException('No email sender configured (did you set the API key?)');
        }

        if (! $this->emailMapper) {
            throw new LogicException('No email mapper configured');
        }

        $output->writeln('Finding email by ID');

        $emailId = $input->getArgument('id');

        $email = $this->emailMapper->findById($emailId);

        if (!$email or $email->isNew()) {
            throw new OutOfBoundsException('Email not found.');
        }

        $output->writeln('Sending email');

        list($email, $result) = $this->emailSender->send($email);

        if ($email->getStatus() !== EmailEntity::STATUS_SENT) {
            $format = 'Email did NOT send successfully. Returned with status %s.';
            $message = sprintf($format, $result['status']);

            if (isset($result['reject_reason'])) {
                $message .= ' Reason rejected: '.$result['reject_reason'];
            }

            $output->writeln($message);

            return 500;
        }

        $output->writeln('Email sent successfully!');
    }
494416
public void writeInt(OutputStream out, int value) throws IOException {
        writeStartArray(out);
        writeIntInternal(out, value);
        writeEndArray(out);
    }