Code example for PipedOutputStream

0
 
public class UsesDOMParser { 
 
	public static void main(String[] args) throws Exception {
		PipedInputStream in = new PipedInputStream();
		final PipedOutputStream out = new PipedOutputStream(in);
 
		Thread t = new Thread() {
			public void run() { 
				try { 
					String str =
						"<?xml version=\"1.0\"?>\n" 
							+ "<test>\n" 
							+ "   <goes>\n" 
							+ "      <here>yeah</here>\n" 
							+ "   </goes>\n" 
							+ "</test>\n"; 
 
					PrintWriter o = new PrintWriter(out);
					o.println(str);
Experience pair programming with AI  Get Codota for Java