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
ABundledStreamis an abstraction that contains anInputStreamand aStreamDescriptor. The descriptors are being used by theNodes to decide if they can / will handle this stream or not.Example:
We have aStreamBundlecontaining twoStreams, 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 voidclose()Closes the encapsulated input stream.StreamDescriptorgetDescriptor()Get the associatedStreamDescriptor.com.levigo.jadice.document.io.SeekableInputStreamgetInputStream()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 IOExceptionDescription copied from interface:StreamGet the associatedSeekableInputStream.- Specified by:
getInputStreamin interfaceStream- Returns:
- the Stream's content
- Throws:
IOException- if an I/O error occurs accessing theInputStream
-
getDescriptor
public StreamDescriptor getDescriptor()
Description copied from interface:StreamGet the associatedStreamDescriptor.- Specified by:
getDescriptorin interfaceStream- Returns:
- the Stream's
StreamDescriptor
-
close
public void close() throws IOExceptionDescription copied from interface:StreamCloses the encapsulated input stream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceStream- Throws:
IOException
-
-