FileDocCategorySizeDatePackage
SplitOutExample.javaAPI DocExample1691Wed May 18 09:39:00 BST 2005com.discursive.jccook.io

SplitOutExample

public class SplitOutExample extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

		new SplitOutExample().start();
	
public voidstart()

		File test1 = new File("split1.txt");
		File test2 = new File("split2.txt");
		OutputStream outStream = null;
		
		try {
			FileOutputStream fos1 = new FileOutputStream( test1 );
			FileOutputStream fos2 = new FileOutputStream( test2 );
			outStream = new TeeOutputStream( fos1, fos2 );
			
			outStream.write( "One Two Three, Test".getBytes() );
		} catch( IOException ioe ) {
			System.out.println( "Error writing to split output stream" );
		} finally {
			IOUtils.closeQuietly( outStream );
		}