Package jadex.common
Class MultiStream
java.lang.Object
java.io.OutputStream
jadex.common.MultiStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Dispatch the write calls to a number of
specified output streams.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Set<OutputStream> The disabled streams.protected OutputStream[]The output streams. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the streams.voidflush()Flush the streams.Get the output streams.voidsetEnabled(OutputStream out, boolean enabled) Set the enabled state of a stream.voidsetOutputStreams(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.Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Field Details
-
outs
The output streams. -
disabled
The disabled streams.
-
-
Constructor Details
-
MultiStream
Create a new multi stream.- Parameters:
outs- The output streams.
-
-
Method Details
-
write
Write a byte to the streams.- Specified by:
writein classOutputStream- Parameters:
b- The byte.- Throws:
IOException
-
write
Write a byte array to the streams.- Overrides:
writein classOutputStream- Parameters:
b- The byte.off- The start offset.len- The length.- Throws:
IOException
-
close
Close the streams.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
Flush the streams.- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
getOutputStreams
Get the output streams.- Returns:
- The output streams.
-
setOutputStreams
Set the output streams.- Parameters:
outs- The output streams.
-
setEnabled
Set the enabled state of a stream.- Parameters:
out- The output stream.enabled- The enabled state.
-