1 21 22 package nu.xom.samples; 23 24 import java.io.IOException ; 25 import java.io.OutputStream ; 26 27 import nu.xom.Document; 28 import nu.xom.Serializer; 29 30 40 public class EZSerializer { 41 42 43 58 public static void write(Document doc, OutputStream out) 59 throws IOException { 60 Serializer serializer = new Serializer(out); 61 serializer.write(doc); 62 serializer.flush(); 63 } 64 65 98 public static void write(Document doc, OutputStream out, String encoding, 99 int indent, int maxLength) 100 throws IOException { 101 Serializer serializer = new Serializer(out, encoding); 102 serializer.setIndent(indent); 103 serializer.setMaxLength(maxLength); 104 serializer.write(doc); 105 serializer.flush(); 106 } 107 108 } 109 | Popular Tags |