Package org.javarosa.core.util
Class MultiInputStream
java.lang.Object
java.io.InputStream
org.javarosa.core.util.MultiInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
public class MultiInputStream extends InputStream
MultiInputStream allows for concatenating multiple
input streams together to be read serially in the
order that they were added.
A MultiInputStream must have all of its component
streams added to it before it can be read from. Once
the stream is ready, it should be prepare()d before
the first read.
- Author:
- Clayton Sims
-
Constructor Summary
Constructors Constructor Description MultiInputStream() -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
MultiInputStream
public MultiInputStream()
-
-
Method Details
-
addStream
-
prepare
public boolean prepare()Finalize the stream and allow it to be read from.- Returns:
- True if the stream is ready to be read from. False if the stream couldn't be prepared because it was empty.
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-