mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8297299: SequenceInputStream should not use Vector
Reviewed-by: alanb, jpai
This commit is contained in:
parent
f0e99c6346
commit
069685489a
1 changed files with 6 additions and 9 deletions
|
@ -25,9 +25,10 @@
|
|||
|
||||
package java.io;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Objects;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
* A {@code SequenceInputStream} represents
|
||||
|
@ -39,12 +40,12 @@ import java.util.Vector;
|
|||
* and so on, until end of file is reached
|
||||
* on the last of the contained input streams.
|
||||
*
|
||||
* @author Author van Hoff
|
||||
* @author Arthur van Hoff
|
||||
* @since 1.0
|
||||
*/
|
||||
public class SequenceInputStream extends InputStream {
|
||||
Enumeration<? extends InputStream> e;
|
||||
InputStream in;
|
||||
private final Enumeration<? extends InputStream> e;
|
||||
private InputStream in;
|
||||
|
||||
/**
|
||||
* Initializes a newly created {@code SequenceInputStream}
|
||||
|
@ -79,11 +80,7 @@ public class SequenceInputStream extends InputStream {
|
|||
* @param s2 the second input stream to read.
|
||||
*/
|
||||
public SequenceInputStream(InputStream s1, InputStream s2) {
|
||||
Vector<InputStream> v = new Vector<>(2);
|
||||
v.addElement(s1);
|
||||
v.addElement(s2);
|
||||
e = v.elements();
|
||||
peekNextStream();
|
||||
this(Collections.enumeration(Arrays.asList(s1, s2)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue