Package VASSAL.tools.io
Class CompositeInputStream
java.lang.Object
java.io.InputStream
VASSAL.tools.io.CompositeInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An
InputStream which concatenates other InputStreams.
As with SequenceInputStream, the first stream is read until EOF,
followed by the second, and so on, until all input streams are exhausted.
Note: SequenceInputStream.available() returns only the number of
bytes available from the current stream in the sequence, which makes it
difficult to efficiently allocate a buffer into which to read the bytes.- Since:
- 3.1.0
- Author:
- Joel Uckelman
- See Also:
SequenceInputStream
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCompositeInputStream(InputStream... streams)Creates aCompositeInputStreamfrom the given sequence ofInputStreams.CompositeInputStream(List<InputStream> streams)Creates aCompositeInputStreamfrom the given sequence ofInputStreams. -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
queue
-
in
-
-
Constructor Details
-
CompositeInputStream
Creates aCompositeInputStreamfrom the given sequence ofInputStreams.- Parameters:
streams- theInputStreams to be concatenated
-
CompositeInputStream
Creates aCompositeInputStreamfrom the given sequence ofInputStreams.- Parameters:
streams- theInputStreams to be concatenated
-
-
Method Details
-
nextStream
- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-