FileDocCategorySizeDatePackage
MultiOutputStream.javaAPI DocExample1285Sat Feb 04 06:04:44 GMT 2006com.elharo.io

MultiOutputStream

public class MultiOutputStream extends FilterOutputStream

Fields Summary
private List
streams
Constructors Summary
public MultiOutputStream(OutputStream out)


     
    super(out);
    streams.add(out);
  
Methods Summary
public voidaddOutputStream(java.io.OutputStream out)

    streams.add(out);
  
public voidclose()

    Iterator iterator = streams.iterator();
    while (iterator.hasNext()) {
      OutputStream out = (OutputStream) iterator.next();
      out.close();
    }
  
public voidflush()

    Iterator iterator = streams.iterator();
    while (iterator.hasNext()) {
      OutputStream out = (OutputStream) iterator.next();
      out.flush();
    }
  
public voidwrite(int b)

  
    Iterator iterator = streams.iterator();
    while (iterator.hasNext()) {
      OutputStream out = (OutputStream) iterator.next();
      out.write(b);
    }
  
public voidwrite(byte[] data, int offset, int length)

    Iterator iterator = streams.iterator();
    while (iterator.hasNext()) {
      OutputStream out = (OutputStream) iterator.next();
      out.write(data, offset, length);
    }