Java tutorial
//package com.java2s; import java.io.IOException; import java.io.OutputStream; public class Main { public static void endXmlNode(OutputStream out, String indent, String name) throws IOException { print(out, indent); endXmlNode(out, name); } public static void endXmlNode(OutputStream out, String name) throws IOException { out.write('<'); out.write('/'); print(out, name); out.write('>'); out.write('\n'); } public static void print(OutputStream out, String str) throws IOException { out.write(str.getBytes("UTF-8")); //$NON-NLS-1$ } }