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:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCompositeInputStream
(InputStream... streams) Creates aCompositeInputStream
from the given sequence ofInputStream
s.CompositeInputStream
(List<InputStream> streams) Creates aCompositeInputStream
from the given sequence ofInputStream
s. -
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 aCompositeInputStream
from the given sequence ofInputStream
s.- Parameters:
streams
- theInputStream
s to be concatenated
-
CompositeInputStream
Creates aCompositeInputStream
from the given sequence ofInputStream
s.- Parameters:
streams
- theInputStream
s to be concatenated
-
-
Method Details
-
nextStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-