This node is a supernode and we only write it to file in order to be able
to re-load it in another session. It can be loaded by
{@link #readSuperNode}.

@param out object output
326718
public void writeSuperNode(ObjectOutput out) throws IOException {
    if(!isSuperNode()) {
      throw new IllegalStateException("Cannot write as non-super node via writeSuperNode()");
    }
    // write header
    writeExternal(out);
    for(Entry entry : entries) {
      if(entry == null) {
        break;
      }
      entry.writeExternal(out);
    }
  }
626294
public void write(Writer out)
         throws IOException
    {
        for (int i=0; i <elements.size() ; i++)
        {
            Object element = elements.get(i);
          
            if (element instanceof Element)
                ((Element)element).write(out);
            else if (element==null)
                out.write("null");
            else 
                out.write(element.toString());
        }
    }
53356
public void releaseNode(final NodeId node) throws Exception {
		Lockable<SharedBufferNode> sharedBufferNode = sharedBuffer.getEntry(node);
		if (sharedBufferNode != null) {
			if (sharedBufferNode.release()) {
				removeNode(node, sharedBufferNode.getElement());
			} else {
				sharedBuffer.upsertEntry(node, sharedBufferNode);
			}
		}
	}
49074
public void writeExternal(ObjectOutput out) throws IOException {

		out.writeLong(calleeCSeq);
		out.writeLong(callerCSeq);
		out.writeUTF(calleeContact.toString());
		out.writeUTF(callerContact.toString());

		out.writeInt(calleeRouteSet.size());
		Iterator<javax.sip.address.Address> i = calleeRouteSet.iterator();
    	while (i.hasNext()) {
    		javax.sip.address.Address a = i.next();
    		out.writeUTF(a.toString());
    	}

    	out.writeInt(callerRouteSet.size());
		i = callerRouteSet.iterator();
    	while (i.hasNext()) {
    		javax.sip.address.Address a = i.next();
    		out.writeUTF(a.toString());
    	}

    	out.writeUTF(toHeader.getAddress().toString());
    	out.writeUTF(toHeader.getTag());
    	out.writeUTF(fromHeader.getAddress().toString());
		out.writeUTF(fromHeader.getTag());
		out.writeUTF(callId);
	}
1149311
public void write(Tree<?, ?> tree) throws IOException {
        this.writer.append("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"); //$NON-NLS-1$
        this.writer.append("<gxl>\n"); //$NON-NLS-1$

        if (tree != null) {
            this.writer.append("\t<graph id=\""); //$NON-NLS-1$
            this.writer.append(Integer.toHexString(System.identityHashCode(new Integer(tree.hashCode()))));
            this.writer.append("-"); //$NON-NLS-1$
            this.writer.append(Integer.toString(this.graphIndex++));
            this.writer.append("\" edgeids=\"true\" edgemode=\"directed\">\n"); //$NON-NLS-1$

            // Write the node attributes
            Iterator<? extends TreeNode<?, ?>> iterator = tree.broadFirstIterator();
            TreeNode<?, ?> node;
            int dataCount;
            while (iterator.hasNext()) {
                node = iterator.next();
                dataCount = node.getUserDataCount();
                final String name = "NODE" + Integer.toHexString(node.hashCode()); //$NON-NLS-1$
                final String label = Integer.toString(dataCount);

                this.writer.append("\t\t<node id=\""); //$NON-NLS-1$
                this.writer.append(name);
                this.writer.append("\">\n"); //$NON-NLS-1$

                this.writer.append("\t\t\t<attr name=\"label\">\n"); //$NON-NLS-1$
                this.writer.append("\t\t\t\t<string>"); //$NON-NLS-1$
                this.writer.append(label);
                this.writer.append("</string>\n"); //$NON-NLS-1$
                this.writer.append("\t\t\t</attr>\n"); //$NON-NLS-1$

                this.writer.append("\t\t</node>\n"); //$NON-NLS-1$
            }

            // Write the node attributes
            iterator = tree.broadFirstIterator();
            TreeNode<?, ?> child;
            String childName;
            while (iterator.hasNext()) {
                node = iterator.next();
                final String name = "NODE" + Integer.toHexString(node.hashCode()); //$NON-NLS-1$
                if (!node.isLeaf()) {
                    final int childCount = node.getChildCount();
                    for (int i = 0; i < childCount; ++i) {
                        child = node.getChildAt(i);
                        if (child != null) {
                            childName = "NODE" + Integer.toHexString(child.hashCode()); //$NON-NLS-1$

                            this.writer.append("\t\t<edge id=\""); //$NON-NLS-1$
                            this.writer.append(name);
                            this.writer.append("--"); //$NON-NLS-1$
                            this.writer.append(childName);
                            this.writer.append("\" isdirected=\"true\" from=\""); //$NON-NLS-1$
                            this.writer.append(name);
                            this.writer.append("\" to=\""); //$NON-NLS-1$
                            this.writer.append(childName);
                            this.writer.append("\">\n"); //$NON-NLS-1$

                            this.writer.append("\t\t\t<attr name=\"label\">\n"); //$NON-NLS-1$
                            this.writer.append("\t\t\t\t<string>"); //$NON-NLS-1$
                            this.writer.append(Integer.toString(i));
                            this.writer.append("</string>\n"); //$NON-NLS-1$
                            this.writer.append("\t\t\t</attr>\n"); //$NON-NLS-1$

                            this.writer.append("\t\t</edge>\n"); //$NON-NLS-1$
                        }
                    }
                }
            }

            this.writer.append("\t</graph>\n"); //$NON-NLS-1$
        }

        this.writer.append("</gxl>\n"); //$NON-NLS-1$
    }
985615
@Override
    protected void onWrite(@NotNull WireOut outWire) {
        SubHandler handler = handler();
        if (handler != null)
            handler.onWrite(outWire);

        WriteMarshallable w;
        for (int i = 0; i < writers.size(); i++) {
            try {
                w = writers.get(i);
                if (null == w)
                    continue;

                if (isClosing.get())
                    return;

                w.writeMarshallable(outWire);
            } catch (Exception e) {
                Jvm.fatal().on(getClass(), e);
            }
        }
    }
864360
protected void readDataOutput(org.w3c.dom.Node xmlNode, StartNode startNode) {
        String id = ((Element) xmlNode).getAttribute("id");
        String outputName = ((Element) xmlNode).getAttribute("name");
        dataOutputs.put(id, outputName);
    }
468318
public final void write (@Nonnull final NODETYPE aNode, @Nonnull @WillNotClose final OutputStream aOS)
  {
    ValueEnforcer.notNull (aNode, "Node");
    ValueEnforcer.notNull (aOS, "OutputStream");

    // Create a writer for the passed output stream
    final NonBlockingBufferedWriter aWriter = new NonBlockingBufferedWriter (StreamHelper.createWriter (aOS,
                                                                                                        m_aSettings.getCharset ()));
    // Inside the other write method, the writer must be flushed!
    write (aNode, aWriter);
    // Do not close the writer!
  }
145882
private void writeObject(ObjectOutputStream out) throws IOException {
        if (!_peer.equals(this) && !(_peer instanceof Serializable)) {
            throw new IOException("Bean context child delegate does not support serialization!!!");
        }
        out.defaultWriteObject();
    }
784424
private void writeObject(final ObjectOutputStream out)
		throws IOException
	{
		final Object value = get();
		out.defaultWriteObject();
		out.writeObject(value);
	}
1239442
public Object with(XMLOutput out, Closure c) {
        XMLOutput old = setOutput(out);
        try {
            c.setDelegate(this);
            return c.call();
        } finally {
            setOutput(old);
        }
    }
671956
private void writeObject(ObjectOutputStream out) throws IOException {
        ObjectOutputStream.PutField fields = out.putFields();
        fields.put("language", baseLocale.getLanguage());
        fields.put("script", baseLocale.getScript());
        fields.put("country", baseLocale.getRegion());
        fields.put("variant", baseLocale.getVariant());
        fields.put("extensions", localeExtensions == null ? "" : localeExtensions.getID());
        fields.put("hashcode", -1); // place holder just for backward support
        out.writeFields();
    }
588939
@Override
  public void writeExternal(ObjectOutput out) throws IOException {
    super.writeExternal(out);
    // TODO: do we need to write/read the capacity?
    out.writeInt(entries.length);
    for(Entry entry : entries) {
      if(entry == null) {
        break;
      }
      entry.writeExternal(out);
    }
  }
712210
private void writeObject(java.io.ObjectOutputStream s)
        throws java.io.IOException {
        // Write out any hidden serialization magic
        s.defaultWriteObject();

        // Write out size
        s.writeInt(size);

        // Write out all elements in the proper order.
        for (Node<E> x = first; x != null; x = x.next)
            s.writeObject(x.item);
    }
559610
public static void write(Node node, OutputStream out, String charset, int indent) {
		transform(new DOMSource(node), new StreamResult(out), charset, indent);
	}
65909
public final void write (@Nonnull final NODETYPE aNode, @Nonnull @WillNotClose final Writer aWriter)
  {
    final XMLEmitter aXMLWriter = createXMLEmitter (aWriter, m_aSettings);
    // No parent node
    // No previous and no next sibling
    emitNode (aXMLWriter, null, null, aNode, null);
    // Flush is important for Writer!
    StreamHelper.flush (aWriter);
  }
308981
public static void setOutputStream(final OutputStream out) {
        LowLevelLogUtil.writer = new PrintWriter(Objects.requireNonNull(out), true);
    }