home *** CD-ROM | disk | FTP | other *** search
- package java.io;
-
- import java.util.Enumeration;
- import java.util.Vector;
-
- public class SequenceInputStream extends InputStream {
- // $FF: renamed from: e java.util.Enumeration
- Enumeration field_0;
- // $FF: renamed from: in java.io.InputStream
- InputStream field_1;
-
- public SequenceInputStream(Enumeration e) {
- this.field_0 = e;
-
- try {
- this.nextStream();
- } catch (IOException var2) {
- throw new Error("panic");
- }
- }
-
- public SequenceInputStream(InputStream s1, InputStream s2) {
- Vector v = new Vector(2);
- v.addElement(s1);
- v.addElement(s2);
- this.field_0 = v.elements();
-
- try {
- this.nextStream();
- } catch (IOException var4) {
- throw new Error("panic");
- }
- }
-
- final void nextStream() throws IOException {
- if (this.field_1 != null) {
- this.field_1.close();
- }
-
- this.field_1 = this.field_0.hasMoreElements() ? (InputStream)this.field_0.nextElement() : null;
- }
-
- public int read() throws IOException {
- if (this.field_1 == null) {
- return -1;
- } else {
- int c = this.field_1.read();
- if (c == -1) {
- this.nextStream();
- return this.read();
- } else {
- return c;
- }
- }
- }
-
- public int read(byte[] buf, int pos, int len) throws IOException {
- if (this.field_1 == null) {
- return -1;
- } else {
- int n = this.field_1.read(buf, pos, len);
- if (n <= 0) {
- this.nextStream();
- return this.read(buf, pos, len);
- } else {
- return n;
- }
- }
- }
-
- public void close() throws IOException {
- do {
- this.nextStream();
- } while(this.field_1 != null);
-
- }
- }
-