public interface StreamBundle extends Iterable<Stream>, Iterator<Stream>
Stream
s. The streams may be added asynchronously, therefore
access to the streams is purely iterative.Modifier and Type | Method and Description |
---|---|
void |
abort()
Close all bundled streams and shut everything down.
|
void |
addStream(InputStream stream,
StreamDescriptor type)
Convenience method: add the given
InputStream along with its StreamDescriptor
by wrapping it in a BundledStream . |
void |
addStream(Stream s)
Add a Stream to this bundle.
|
OutputStream |
addStream(StreamDescriptor type)
Convenience method: add a
DynamicPipe for the given
StreamDescriptor , and return as the OutputStream the write
end of the pipe. |
void |
complete()
Signal the completeness of the stream bundle.
|
boolean |
hasNext()
Check whether there are more streams to be retrieved.
|
boolean |
isComplete()
Return whether this bundle is complete, i.e.
|
Iterator<Stream> |
iterator() |
Stream |
next()
Retrieve the next stream This method may block until either a new stream is available, or the
completeness of the bundle has been signaled.
|
void |
remove()
Not supported! Throws a
UnsupportedOperationException . |
void addStream(InputStream stream, StreamDescriptor type) throws IOException
InputStream
along with its StreamDescriptor
by wrapping it in a BundledStream
.stream
- The InputStream
to addtype
- the associated StreamDescriptor
IOException
- might be thrown if an error occurs when the given InputStream
is wrapped to a SeekableInputStream
OutputStream addStream(StreamDescriptor type) throws IOException
DynamicPipe
for the given
StreamDescriptor
, and return as the OutputStream
the write
end of the pipe.type
- IOException
void addStream(Stream s)
s
- IOException
boolean hasNext()
hasNext
in interface Iterator<Stream>
Iterator.hasNext()
Stream next()
next
in interface Iterator<Stream>
IndexOutOfBoundsException
- if there are no more streams.Iterator.next()
void remove()
UnsupportedOperationException
.remove
in interface Iterator<Stream>
Iterator.remove()
boolean isComplete()
hasNext()
by never blocking.void complete()
void abort()
complete()
.Copyright © 2017 levigo holding gmbh. All rights reserved.