Jadex 0.96-beta1

jadex.util
Class MultiStream

java.lang.Object
  extended by java.io.OutputStream
      extended by jadex.util.MultiStream
All Implemented Interfaces:
Closeable, Flushable

public class MultiStream
extends OutputStream

Dipatch the write calls to a number of specified output streams.


Constructor Summary
MultiStream(OutputStream[] outs)
          Create a new multi stream.
 
Method Summary
 void close()
          Close the streams.
 void flush()
          Flush the streams.
 OutputStream[] getOutputStreams()
          Get the output streams.
 void setEnabled(OutputStream out, boolean enabled)
          Set the enabled state of a stream.
 void setOutputStreams(OutputStream[] outs)
          Set the output streams.
 void write(byte[] b, int off, int len)
          Write a byte array to the streams.
 void write(int b)
          Write a byte to the streams.
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiStream

public MultiStream(OutputStream[] outs)
Create a new multi stream.

Parameters:
outs - The output streams.
Method Detail

write

public void write(int b)
           throws IOException
Write a byte to the streams.

Specified by:
write in class OutputStream
Parameters:
b - The byte.
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Write a byte array to the streams.

Overrides:
write in class OutputStream
Parameters:
b - The byte.
off - The start offset.
len - The length.
Throws:
IOException

close

public void close()
           throws IOException
Close the streams.

Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Flush the streams.

Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

getOutputStreams

public OutputStream[] getOutputStreams()
Get the output streams.

Returns:
The output streams.

setOutputStreams

public void setOutputStreams(OutputStream[] outs)
Set the output streams.

Parameters:
outs - The output streams.

setEnabled

public void setEnabled(OutputStream out,
                       boolean enabled)
Set the enabled state of a stream.

Parameters:
out - The output stream.
enabled - The enabled state.

Jadex 0.96-beta1

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.