Writes string to output.

@param string $string String to write
@param int    $writer Output type
349706
public function write(string $string, int $writer = Output::STANDARD): void
	{
		if($this->muted)
		{
			return;
		}

		$writer = $this->getWriter($writer);

		if($this->formatter !== null)
		{
			if($this->environment->hasAnsiSupport() === false || $writer->isDirect() === false)
			{
				$string = $this->formatter->stripTags($string);
			}

			$string = $this->formatter->format($string);
		}

		$writer->write($string);
	}
470075
private void write(String str) {
        try {
            m_writer.write(str);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }
809083
public function write($text, $type = 'stdout')
    {
        if (in_array($type, ['stdout', 'stderr']) && ! empty($text)) {
            $f = fopen('php://' . $type, 'w');

            if (is_array($text)) {
                $text = json_encode($text);
            }

            fwrite($f, $text);
            fclose($f);
        }
    }
506275
public function append($string)
    {
        $pos = ftell($this->stream);
        fseek($this->stream, 0, SEEK_END);
        fwrite($this->stream, $string);
        fseek($this->stream, $pos);
    }
79616
public void write(String s) throws IOException {
	    if (writer != null) {
	        writer.write(s);
	    } else {
	        write(s, 0, s.length());
	    }
    }
896695
public function write($string)
    {
        $fileName = $this->getFileName();
        $handle = $this->getHandle();

        if (fwrite($handle, $string) === false) {
            throw new \Exception('Cannot write to file ' . $fileName);
        }
    }
1065807
public static void encode (Writer writer, String string, boolean encodeNewline) throws IOException
    {
        encode(writer, string, encodeNewline, true);
    }
829916
public void writeToWriter(Writer out) throws IOException
  {
    int ch;

    while ((ch = readChar()) >= 0) {
      out.write((char) ch);
    }
  }
311450
public function write($string)
    {
        if ($this->isWritable()) {
            $size = $this->getSize();
            $count = fwrite($this->stream, $string);
            $this->setSize($size + $count);
            return $count;
        } else {
            return false;
        }
    }
1368019
public void write(Writer out)
         throws IOException
    {
        out.write("<!--\n");
        super.write(out);
        out.write("\n-->");
    }
1101056
public function set($string)
    {
        $this->clear();

        fwrite($this->stream, $string);
        rewind($this->stream);
    }
1164239
public static void string2Writer(String source, Writer out) throws IOException {

		char[] buffer = source.toCharArray();
		for (int i = 0; i < buffer.length; i++) {
			out.append(buffer[i]);
		}
		out.flush();
	}
1352354
public function writeString($string) {

            $this->stream->writeInt(strlen($string));
            $this->stream->writeBuffer($string);

        }
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;
    }
452465
protected final void write(String string)
    {
        JspWriter writer = pageContext.getOut();
        try {
            writer.print(string);
        }
        catch (IOException e) {
            logger.error(Bundle.getString("Tags_WriteException"), e);
            org.apache.struts.util.RequestUtils.saveException((PageContext) pageContext, e);
        }
    }
582813
public function write($string)
    {
        if ($this->fd) {
            $ret = fwrite($this->fd, $string);
            if ($ret !== FALSE) {
                return $ret; 
            }
        }

        return false;
    }
723669
public static void copy(String in, Writer out) throws IOException {
		Assert.notNull(in, "No input String specified");
		Assert.notNull(out, "No Writer specified");
		try {
			out.write(in);
		}
		finally {
			try {
				out.close();
			}
			catch (IOException ex) {
			}
		}
	}