GeezerVison is showing docs.oracle.com — SequenceInputStream (Java SE 11 & JDK 11 )
Class SequenceInputStream
-
- All Implemented Interfaces:
Closeable, AutoCloseable
public class SequenceInputStream
extends InputStream
A SequenceInputStream represents
the logical concatenation of other input
streams. It starts out with an ordered
collection of input streams and reads from
the first one until end of file is reached,
whereupon it reads from the second one,
and so on, until end of file is reached
on the last of the contained input streams.
- Since:
- 1.0
-
-
Constructor Summary
Constructors
| Constructor |
Description |
SequenceInputStream(InputStream s1,
InputStream s2) |
Initializes a newly
created SequenceInputStream
by remembering the two arguments, which
will be read in order, first s1
and then s2, to provide the
bytes to be read from this SequenceInputStream.
|
SequenceInputStream(Enumeration<? extends InputStream> e) |
Initializes a newly created SequenceInputStream
by remembering the argument, which must
be an Enumeration that produces
objects whose run-time type is InputStream.
|
-
Method Summary
All Methods Instance Methods Concrete Methods
| Modifier and Type |
Method |
Description |
int |
available() |
Returns an estimate of the number of bytes that can be read (or
skipped over) from the current underlying input stream without
blocking by the next invocation of a method for the current
underlying input stream.
|
void |
close() |
Closes this input stream and releases any system resources
associated with the stream.
|
int |
read() |
Reads the next byte of data from this input stream.
|
int |
read(byte[] b,
int off,
int len) |
Reads up to len bytes of data from this input stream
into an array of bytes.
|
-
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
SequenceInputStream
public SequenceInputStream(Enumeration<? extends InputStream> e)
Initializes a newly created SequenceInputStream
by remembering the argument, which must
be an Enumeration that produces
objects whose run-time type is InputStream.
The input streams that are produced by
the enumeration will be read, in order,
to provide the bytes to be read from this
SequenceInputStream. After
each input stream from the enumeration
is exhausted, it is closed by calling its
close method.
- Parameters:
e - an enumeration of input streams.
- See Also:
Enumeration
-
SequenceInputStream
public SequenceInputStream(InputStream s1,
InputStream s2)
Initializes a newly
created SequenceInputStream
by remembering the two arguments, which
will be read in order, first s1
and then s2, to provide the
bytes to be read from this SequenceInputStream.
- Parameters:
s1 - the first input stream to read.
s2 - the second input stream to read.
|