Write an element to the stream.

@param mixed $element
@return void
778856
protected function writeElement($element): void
    {
        $json = $this->jsonEncode($element);

        fwrite($this->stream, $this->delimiter . $json);

        if (!isset($this->delimiter)) {
            $this->delimiter = (($this->options & self::OUTPUT_LINES) > 0 ? '' : ',') . "\n";
        }
    }
929951
public function write($bytes)
    {
        $this->out += strlen($bytes);
        foreach ($this->mirrors as $stream) {
            $stream->write($bytes);
        }
    }
837896
public function write(string $data) : void
    {
        $this->buffer .= $data;

        if (strlen($this->buffer) >= $this->size) {
            $this->flush();
        }
    }
639058
protected function addAttributes($element, $data)
    {
        foreach ($data as $attrKey => $attrVal) {
            $element->setAttribute($attrKey, $attrVal);
        }
    }
96523
public function write($string) {
        if ( ! is_array($string)) {
            $string = [$string];
        }

        foreach ($string as $item) {
            $this->buffer .= $item;
        }
    }
798311
public function remove($element): bool
    {
        if (($position = \array_search($element, $this->data, true)) !== false) {
            unset($this->data[$position]);

            return true;
        }

        return false;
    }
167157
public function pushScalar(array $element) {
        if(!empty($element['required'])) {
            $this->hasRequired = true;
        }
        if(empty($this->containers)) {
            $this->array += $element;
        } else {
            $this->containers[count($this->containers) - 1][\Illuminate\Support\Arr::get($element, 'id')] = $element;
        }
    }
528248
public function write() : void
    {
        if (!$this->features) {
            return;
        }
        $i = 0;
        while (true) {
            $file = sprintf('%s/%s%s.php', $this->config->output, $this->normalize($this->objectUnderTest->getName()), $i ? ".$i" : '');
            if (!file_exists($file)) {
                break;
            }
            ++$i;
        }
        file_put_contents($file, $this->render());
    }
939969
public function write($file = '') {
        if ($file == '') {
            $file = $this->outSourceFile;
        }

        file_put_contents($file, $this->generate());
    }
1286592
private function writeDocument(\DOMDocument $dom)
    {
        $dom->formatOutput = true;
        $this->write($dom->saveXML());
    }
346379
public function accumulate($element, $key)
    {
        $accumulate = $this->accumulator;
        $accumulate($this->structure, $element, $key);
    }
948665
public function addElement($element)
    {
        if ($this->processing === 'B') {
            $this->pdf->addBody($element);

            return;
        }

        if ($this->processing === 'H') {
            $this->pdf->addHeader($element);

            return;
        }

        if ($this->processing === 'F') {
            $this->pdf->addFooter($element);

            return;
        }
    }
287879
public function remove($element)
    {
        $hash = $this->hash($element);
        if (isset($this->hashTable[$hash])) {
            $i = array_search($element, $this->hashTable[$hash], true);
            if ($i !== false) {
                unset($this->hashTable[$hash][$i]);
                return true;
            }
        }
        return false;
    }
839478
public function writeElement($key, $value)
    {
        if (is_array($value)) {
            $this->iterateArray($key, $value);
        } else {
            $value = \Genesis\Utils\Common::booleanToString($value);

            $this->context->writeElement($key, $value);
        }
    }
1063064
final public function write($xml)
    {

        if($xml instanceof \SimpleXMLElement){
            $xml = $xml->asXML();
        } elseif($xml instanceof \DOMDocument){
            $xml = $xml->saveXML();
        }

        $this->log("SENT: ".$xml);

        return parent::write($xml);
    }
1345368
public function writeFloat($float)
    {
        try {
            $this->getStream()->write(pack('d', $float));
        } catch (StreamException $e) {
            $this->handleStreamException($e, BinaryStreamAccessException::FLOAT, false);
        }
    }
124439
protected function convert(DOMElement $element, $storage): void
    {
        if (\is_object($storage)) {
            $element->appendChild($element->ownerDocument->importNode($storage));
            return;
        }

        if (!\is_array($storage)) {
            $element->nodeValue = \htmlspecialchars($storage);
            return;
        }

        if (empty($storage)) {
            throw new Exceptions\Blank('Array is empty');
        }

        $isInt      = Arr::map(Arr::getKeys($storage), '\is_int');
        $sequential = !Arr::in($isInt, false);

        foreach ($storage as $key => $data) {
            if ($sequential) {
                $this->sequential($element, $data);
                continue;
            }

            $this->addNodeWithKey($key, $element, $data);
        }
    }