Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.udo.cs.miningmart.m4.utils
Class MultipleOutputStream

    java.lang.Object
      java.io.OutputStream
          edu.udo.cs.miningmart.m4.utils.MultipleOutputStream

All Implemented Interfaces:
  java.io.Closeable, java.io.Flushable

    public class MultipleOutputStream

extends java.io.OutputStream

A `MultipleOutputStream` holds several `OutputStream`s. Each method called by this `OutputStream` is forwarded to the set of `OutputStream`s. So you can write something to `System.out` and to a file.

Version:
  $Id: MultipleOutputStream.java,v 1.4 2006/09/27 14:59:55 euler Exp $
Author:
  Daniel Hakenjos

Constructor Summary
`MultipleOutputStream()` Inits this `MultipleOutputStream` containing no `OutputStream`.
`MultipleOutputStream(java.util.Collection outputStreams)` Inits this `MultipleOutputStream` with the specified `Collection` of `OutputStream`s.
`MultipleOutputStream(java.io.OutputStream stream)` Inits this `MultipleOutputStream` only containing th specified `OutputStream`.

Method Summary
`void` | `addOutputStream(java.io.OutputStream stream)` Adds the `OutputStream`.
`void` | `close()`
`boolean` | `containsOutputStream(java.io.OutputStream stream)` Checks wether the `OutputStream` is available or not.
`void` | `flush()`
`int` | `getNumberOfOutputStreams()` Gets the number of `OutputStream`s.
`java.io.OutputStream` | `getOutputStream(int index)` Gets the `OutputStream` by its index.
`boolean` | `removeOutputStream(java.io.OutputStream stream)` Removes the `OutputStream`.
`void` | `write(byte[] b)`
`void` | `write(byte[] b, int off, int len)`
`void` | `write(int b)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MultipleOutputStream

    public MultipleOutputStream()

  Inits this `MultipleOutputStream` containing no `OutputStream`.

### MultipleOutputStream

    public MultipleOutputStream(java.io.OutputStream stream)

  Inits this `MultipleOutputStream` only containing th specified `OutputStream`.

### MultipleOutputStream

    public MultipleOutputStream(java.util.Collection outputStreams)

  Inits this `MultipleOutputStream` with the specified `Collection` of `OutputStream`s.

Method Detail

### close

    public void close()
               throws java.io.IOException

  Specified by:
    `close` in interface `java.io.Closeable`
  Overrides:
    `close` in class `java.io.OutputStream`
  Throws:
    `java.io.IOException`
  See Also:
    `OutputStream.close()`

### flush

    public void flush()
               throws java.io.IOException

  Specified by:
    `flush` in interface `java.io.Flushable`
  Overrides:
    `flush` in class `java.io.OutputStream`
  Throws:
    `java.io.IOException`
  See Also:
    `OutputStream.flush()`

### write

    public void write(byte[] b,
                      int off,
                      int len)
               throws java.io.IOException

  Overrides:
    `write` in class `java.io.OutputStream`
  Throws:
    `java.io.IOException`
  See Also:
    `OutputStream.write(byte[], int, int)`

### write

    public void write(byte[] b)
               throws java.io.IOException

  Overrides:
    `write` in class `java.io.OutputStream`
  Throws:
    `java.io.IOException`
  See Also:
    `OutputStream.write(byte[])`

### write

    public void write(int b)
               throws java.io.IOException

  Specified by:
    `write` in class `java.io.OutputStream`
  Throws:
    `java.io.IOException`
  See Also:
    `OutputStream.write(int)`

### getNumberOfOutputStreams

    public int getNumberOfOutputStreams()

  Gets the number of `OutputStream`s.

### getOutputStream

    public java.io.OutputStream getOutputStream(int index)

  Gets the `OutputStream` by its index.

  Returns:
    null if the index is wrong

### addOutputStream

    public void addOutputStream(java.io.OutputStream stream)

  Adds the `OutputStream`.

### removeOutputStream

    public boolean removeOutputStream(java.io.OutputStream stream)

  Removes the `OutputStream`.

### containsOutputStream

    public boolean containsOutputStream(java.io.OutputStream stream)

  Checks wether the `OutputStream` is available or not.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005