Class BundledStream
- java.lang.Object
-
- com.levigo.jadice.server.shared.types.BundledStream
-
- All Implemented Interfaces:
Stream
,Closeable
,AutoCloseable
public class BundledStream extends Object implements Stream
ABundledStream
is an abstraction that contains anInputStream
and aStreamDescriptor
. The descriptors are being used by theNode
s to decide if they can / will handle this stream or not.Example:
We have aStreamBundle
containing twoStream
s, one representing a TIFF file and one representing a GIF file. If we want to do a kind of "GIF2TIFF" conversion in a certainNode
, this worker will only convert the second stream (the GIF file).
-
-
Constructor Summary
Constructors Constructor Description BundledStream(InputStream stream, StreamDescriptor type)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the encapsulated input stream.StreamDescriptor
getDescriptor()
Get the associatedStreamDescriptor
.com.levigo.jadice.document.io.SeekableInputStream
getInputStream()
Get the associatedSeekableInputStream
.
-
-
-
Constructor Detail
-
BundledStream
public BundledStream(InputStream stream, StreamDescriptor type)
Constructor.- Parameters:
stream
- theInputStream
. Must not benull
.type
- the associatedStreamDescriptor
. Must not benull
.
-
-
Method Detail
-
getInputStream
public com.levigo.jadice.document.io.SeekableInputStream getInputStream() throws IOException
Description copied from interface:Stream
Get the associatedSeekableInputStream
.- Specified by:
getInputStream
in interfaceStream
- Returns:
- the Stream's content
- Throws:
IOException
- if an I/O error occurs accessing theInputStream
-
getDescriptor
public StreamDescriptor getDescriptor()
Description copied from interface:Stream
Get the associatedStreamDescriptor
.- Specified by:
getDescriptor
in interfaceStream
- Returns:
- the Stream's
StreamDescriptor
-
close
public void close() throws IOException
Description copied from interface:Stream
Closes the encapsulated input stream.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceStream
- Throws:
IOException
-
-