Formats the complete area tree to an output stream.
@param tree the area tree to be printed
@param out a writer to be used for output
761145
public void dumpTo(AreaTree tree, PrintWriter out)
    {
        if (produceHeader)
        {
            out.println("<!DOCTYPE html>");
            out.println("<html>");
            out.println("<head>");
            out.println("<title>" + tree.getRoot().getPage().getTitle() + "</title>");
            out.println("<meta charset=\"utf-8\">");
            out.println("<meta name=\"generator\" content=\"FITLayout - area tree dump\">");
            out.println("</head>");
            out.println("<body>");
        }
        recursiveDumpArea(tree.getRoot(), 1, out);
        if (produceHeader)
        {
            out.println("</body>");
            out.println("</html>");
        }
    }
1241083
private void output(File outFile) throws FileNotFoundException {
    System.out.println("Printing to " + outFile.toString());
    PrintStream out = new PrintStream(outFile);
    root.output(out, null);
    out.close();
  }
696672
public void writeTo(final CodedOutputStream output)
                      throws IOException {
    for (int i = 0; i < fields.getNumArrayEntries(); i++) {
      final Map.Entry<FieldDescriptorType, Object> entry =
          fields.getArrayEntryAt(i);
      writeField(entry.getKey(), entry.getValue(), output);
    }
    for (final Map.Entry<FieldDescriptorType, Object> entry :
         fields.getOverflowEntries()) {
      writeField(entry.getKey(), entry.getValue(), output);
    }
  }
20637
public void write(PrintStream stream) {
        this.output = stream;
        dispatch(base, false);
        stream.flush();
    }
869903
public void writeTo(OutputStream out) throws IOException {
        out.write(this.content);
        out.flush();
        out.close();
    }
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);
    }
  }
650995
protected void printResults(PrintStream out) {
        log.debug("printResults()");
        StringBuilder line = new StringBuilder();
        out.println(line);
        out.println();
    }
1112586
void writeTo(OutputStream out) throws IOException {
		//TODO could optimize for aligned instances
		final int size = finish - start;
		final int length = (size + 7) >> 3;
		if (length == 0) return;
		int p = size & 7;
		final int q = finish - p;
		if (p != 0) out.write((byte) getBitsAdj(q, p));
		p = q;
		while (p > start) {
			p -= 8;
			out.write((byte) getBitsAdj(p, 8));
		}
	}
170687
public static <T> void writeTo(OutputStream out, T message, Schema<T> schema,
            XMLOutputFactory outFactory) throws IOException
    {
        XMLStreamWriter writer = null;
        try
        {
            writer = outFactory.createXMLStreamWriter(out, XML_ENCODING);

            writer.writeStartDocument(XML_ENCODING, XML_VERSION);
            writeTo(writer, message, schema);
            writer.writeEndDocument();

            writer.flush();
        }
        catch (XMLStreamException e)
        {
            throw new XmlOutputException(e);
        }
        finally
        {
            if (writer != null)
            {
                try
                {
                    writer.close();
                }
                catch (XMLStreamException e)
                {
                    // ignore
                }
            }
        }
    }
192623
void asPresentationML(XmlPrintStream out) {
    out.openElement(getMessageMLTag(), getAttributes());

    for (Element child : getChildren()) {
      child.asPresentationML(out);
    }

    out.closeElement();
  }
727983
private void printSpaces(int count, java.io.PrintStream out) {
        for (int i = 0; i < count; i++) {
            out.print(" ");
        }
    }
708611
public void dumpAll(Iterator<? extends YamlNode> data, OutputStream output) {
        getDelegate().dumpAll(data, new OutputStreamWriter(output, Charset
                                                           .forName("UTF-8")));
    }
801530
private static void print(Node node, PrintWriter out) {
        if (node == null) {
            return;
        }

        boolean hasChildren = false;
        int type = node.getNodeType();
        NodeList children = null;
        switch (type) {
            case Node.DOCUMENT_NODE:
                children = node.getChildNodes();
                if (children != null) {
                    int numChildren = children.getLength();
                    for (int i = 0; i < numChildren; i++) {
                        print(children.item(i), out);
                    }
                }
                break;
            case Node.ELEMENT_NODE:
                out.print('<');
                out.print(node.getNodeName());
                if (node.hasAttributes()) {
                    NamedNodeMap attrs = node.getAttributes();
                    int len = (attrs != null) ? attrs.getLength() : 0;
                    for (int a = 0; a < len; a++) {
                        Attr attr = (Attr) attrs.item(a);
                        out.print(' ');
                        out.print(attr.getNodeName());
                        out.print("=\"");
                        out.print(attr.getValue());
                        out.print('\"');
                    }
                }
                children = node.getChildNodes();
                if (children != null) {
                    int numChildren = children.getLength();
                    hasChildren = (numChildren > 0);
                    if (hasChildren) {
                        out.print('>');
                    }
                    for (int i = 0; i < numChildren; i++) {
                        print(children.item(i), out);
                    }
                } else {
                    hasChildren = false;
                }
                if (!hasChildren) {
                    out.print("/>");
                }
                break;
            case Node.ENTITY_REFERENCE_NODE:
                out.print('&');
                out.print(node.getNodeName());
                out.print(';');
                break;
            case Node.CDATA_SECTION_NODE:
                out.print("<![CDATA[");
                out.print(node.getNodeValue());
                out.print("]]>");
                break;
            case Node.TEXT_NODE:
                out.print(node.getNodeValue());
                break;
            default:
                if (logger.isDebugEnabled()) {
                    logger.debug("Unknown type: " + type);
                }
        }
        if (type == Node.ELEMENT_NODE && hasChildren) {
            out.print("</");
            out.print(node.getNodeName());
            out.print('>');
            hasChildren = false;
        }
    }
1194715
public void write(final OutputStream out) throws IOException {
        if (this.byteOrder == ByteOrder.BIG_ENDIAN) {
            out.write(MAGIC_BIG_ENDIAN);
        } else {
            out.write(MAGIC_LITTLE_ENDIAN);
        }
        out.write(this.body);
    }
1336401
private static <T extends GraphNode<T>> StringBuilder printTree(T node, Formatter<T> formatter,
                                                                    String indent, StringBuilder sb,
                                                                    Predicate<T> nodeFilter,
                                                                    Predicate<T> subTreeFilter) {
        if (nodeFilter.apply(node)) {
            String line = formatter.format(node);
            if (line != null) {
                sb.append(indent).append(line).append("\n");
                indent += "  ";
            }
        }
        if (subTreeFilter.apply(node)) {
            for (T sub : node.getChildren()) {
                printTree(sub, formatter, indent, sb, nodeFilter, subTreeFilter);
            }
        }
        return sb;
    }
674412
@Override
    public void writeTree(JsonGenerator g, TreeNode tree) throws IOException {
        if (_treeCodec == null) {
            _noTreeCodec("write TreeNode");
        }
        _treeCodec.writeTree(g, tree);
    }
617338
public void dumpAll(Iterable<? extends YamlNode> data, OutputStream output) {
        dumpAll(data.iterator(), output);
    }