diff options
author | Tom Tromey <tromey@gcc.gnu.org> | 2007-01-09 19:58:05 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2007-01-09 19:58:05 +0000 |
commit | 97b8365cafc3a344a22d3980b8ed885f5c6d8357 (patch) | |
tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/classpath/java/io/SequenceInputStream.java | |
parent | c648dedbde727ca3f883bb5fd773aa4af70d3369 (diff) | |
download | gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.zip gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.tar.gz gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.tar.bz2 |
Merged gcj-eclipse branch to trunk.
From-SVN: r120621
Diffstat (limited to 'libjava/classpath/java/io/SequenceInputStream.java')
-rw-r--r-- | libjava/classpath/java/io/SequenceInputStream.java | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/libjava/classpath/java/io/SequenceInputStream.java b/libjava/classpath/java/io/SequenceInputStream.java index 7fefe24..5ff85e9 100644 --- a/libjava/classpath/java/io/SequenceInputStream.java +++ b/libjava/classpath/java/io/SequenceInputStream.java @@ -1,5 +1,5 @@ /* SequenceInputStream.java -- Reads multiple input streams in sequence - Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2001, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -71,8 +71,11 @@ public class SequenceInputStream extends InputStream /** Secondary input stream; not used if constructed w/ enumeration. */ private InputStream in2; - /** The enumeration handle; not used if constructed w/ 2 explicit input streams. */ - private Enumeration e; + /** + * The enumeration handle; not used if constructed w/ 2 explicit + * input streams. + */ + private Enumeration<? extends InputStream> e; /** * This method creates a new <code>SequenceInputStream</code> that obtains @@ -82,10 +85,10 @@ public class SequenceInputStream extends InputStream * @param e An <code>Enumeration</code> that will return a list of * <code>InputStream</code>s to read in sequence */ - public SequenceInputStream(Enumeration e) + public SequenceInputStream(Enumeration<? extends InputStream> e) { this.e = e; - in = (InputStream) e.nextElement(); + in = e.nextElement(); in2 = null; } @@ -207,14 +210,13 @@ public class SequenceInputStream extends InputStream if (e != null) { if (e.hasMoreElements()) - nextIn = (InputStream) e.nextElement(); + nextIn = e.nextElement(); + } + else if (in2 != null) + { + nextIn = in2; + in2 = null; } - else - if (in2 != null) - { - nextIn = in2; - in2 = null; - } return nextIn; } |