Package jadex.commons
Class MultiStream
- java.lang.Object
- 
- java.io.OutputStream
- 
- jadex.commons.MultiStream
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.io.Flushable,- java.lang.AutoCloseable
 
 public class MultiStream extends java.io.OutputStreamDispatch the write calls to a number of specified output streams.
- 
- 
Constructor SummaryConstructors Constructor Description MultiStream(java.io.OutputStream[] outs)Create a new multi stream.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the streams.voidflush()Flush the streams.java.io.OutputStream[]getOutputStreams()Get the output streams.voidsetEnabled(java.io.OutputStream out, boolean enabled)Set the enabled state of a stream.voidsetOutputStreams(java.io.OutputStream[] outs)Set the output streams.voidwrite(byte[] b, int off, int len)Write a byte array to the streams.voidwrite(int b)Write a byte to the streams.
 
- 
- 
- 
Method Detail- 
writepublic void write(int b) throws java.io.IOExceptionWrite a byte to the streams.- Specified by:
- writein class- java.io.OutputStream
- Parameters:
- b- The byte.
- Throws:
- java.io.IOException
 
 - 
writepublic void write(byte[] b, int off, int len) throws java.io.IOExceptionWrite a byte array to the streams.- Overrides:
- writein class- java.io.OutputStream
- Parameters:
- b- The byte.
- off- The start offset.
- len- The length.
- Throws:
- java.io.IOException
 
 - 
closepublic void close() throws java.io.IOExceptionClose the streams.- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Overrides:
- closein class- java.io.OutputStream
- Throws:
- java.io.IOException
 
 - 
flushpublic void flush() throws java.io.IOExceptionFlush the streams.- Specified by:
- flushin interface- java.io.Flushable
- Overrides:
- flushin class- java.io.OutputStream
- Throws:
- java.io.IOException
 
 - 
getOutputStreamspublic java.io.OutputStream[] getOutputStreams() Get the output streams.- Returns:
- The output streams.
 
 - 
setOutputStreamspublic void setOutputStreams(java.io.OutputStream[] outs) Set the output streams.- Parameters:
- outs- The output streams.
 
 - 
setEnabledpublic void setEnabled(java.io.OutputStream out, boolean enabled)Set the enabled state of a stream.- Parameters:
- out- The output stream.
- enabled- The enabled state.
 
 
- 
 
-