home *** CD-ROM | disk | FTP | other *** search
- package sun.audio;
-
- import java.io.IOException;
- import java.io.InputStream;
- import java.util.Enumeration;
-
- public class AudioStreamSequence extends InputStream {
- // $FF: renamed from: e java.util.Enumeration
- Enumeration field_0;
- // $FF: renamed from: in java.io.InputStream
- InputStream field_1;
-
- public AudioStreamSequence(Enumeration e) {
- this.field_0 = e;
- this.field_1 = e.hasMoreElements() ? (InputStream)e.nextElement() : null;
- }
-
- public int read() throws IOException {
- if (this.field_1 == null) {
- return -1;
- } else {
- int c = this.field_1.read();
- if (c != -1) {
- return c;
- } else {
- this.field_1.close();
-
- for(this.field_1 = null; this.field_0.hasMoreElements() && this.field_1 == null; this.field_1 = (InputStream)this.field_0.nextElement()) {
- }
-
- return this.read();
- }
- }
- }
-
- 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 < len) {
- if (n < 0) {
- n = 0;
- }
-
- this.field_1.close();
- this.field_1 = this.field_0.hasMoreElements() ? (InputStream)this.field_0.nextElement() : null;
- int m = this.read(buf, pos + n, len - n);
- return m > 0 ? n + m : n;
- } else {
- return n;
- }
- }
- }
- }
-