Java XML Document to Stream dumpToStream(Document doc, OutputStream out)

Here you can find the source of dumpToStream(Document doc, OutputStream out)

Description

dump To Stream

License

Apache License

Declaration

public static void dumpToStream(Document doc, OutputStream out) throws Exception 

Method Source Code

//package com.java2s;

import java.io.OutputStream;
import java.io.PrintWriter;

import javax.swing.text.Document;

public class Main {
    public static void dumpToStream(Document doc, OutputStream out) throws Exception {
        PrintWriter w = new PrintWriter(out);
        w.print(doc.getText(0, doc.getLength()));
        w.close();/*from   w w w  .j a  v a 2s  .  c om*/
        out.close();
    }
}

Related

  1. DocumentToInputStream(Document edoc)
  2. documentToStream(Document document, OutputStream outputStream, String encoding)
  3. dom2InputStream(Document doc)
  4. dumpDoc(Document domTree, PrintStream out)
  5. toXml(Document doc, OutputStream out)
  6. write(Document doc, OutputStream out, String enc)
  7. write(Document document, OutputStream byteStream)
  8. writeDocument(Document doc, OutputStream os)