FileDocCategorySizeDatePackage
MultiOutputStream.javaAPI DocExample1343Sun Mar 28 19:06:18 BST 1999com.macfaq.io

MultiOutputStream

public class MultiOutputStream extends FilterOutputStream

Fields Summary
Vector
streams
Constructors Summary
public MultiOutputStream(OutputStream out)


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

    streams.addElement(out);
  
public synchronized voidclose()


    for (Enumeration e = streams.elements(); e.hasMoreElements();) {
      OutputStream out = (OutputStream) e.nextElement();
      out.close();
    }

  
public synchronized voidflush()


    for (Enumeration e = streams.elements(); e.hasMoreElements();) {
      OutputStream out = (OutputStream) e.nextElement();
      out.flush();
    }

  
public synchronized voidwrite(int b)

  
    for (Enumeration e = streams.elements(); e.hasMoreElements();) {
      OutputStream out = (OutputStream) e.nextElement();
      out.write(b);
    }

  
public synchronized voidwrite(byte[] data, int offset, int length)


    for (Enumeration e = streams.elements(); e.hasMoreElements();) {
      OutputStream out = (OutputStream) e.nextElement();
      out.write(data, offset, length);
    }