1 Clazz.load (["java.io.FilterInputStream"], "java.io.PushbackInputStream", ["java.io.IOException", "java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException", "$.NullPointerException"], function () {
2 c$ = Clazz.decorateAsClass (function () {
5 Clazz.instantialize (this, arguments);
6 }, java.io, "PushbackInputStream", java.io.FilterInputStream);
7 Clazz.defineMethod (c$, "ensureOpen",
9 if (this.$in == null) throw new java.io.IOException ("Stream closed");
11 Clazz.makeConstructor (c$,
12 function ($in, size) {
13 Clazz.superConstructor (this, java.io.PushbackInputStream, [$in]);
15 throw new IllegalArgumentException ("size <= 0");
16 }this.buf = Clazz.newByteArray (size, 0);
18 }, "java.io.InputStream,~N");
19 Clazz.overrideMethod (c$, "readByteAsInt",
22 if (this.pos < this.buf.length) {
23 return this.buf[this.pos++] & 0xff;
24 }return this.$in.readByteAsInt ();
26 Clazz.overrideMethod (c$, "read",
27 function (b, off, len) {
30 throw new NullPointerException ();
32 if (arguments.length == 1) { off = 0; len = b.length; }
34 if (off < 0 || len < 0 || len > b.length - off) {
35 throw new IndexOutOfBoundsException ();
36 } else if (len == 0) {
38 }var avail = this.buf.length - this.pos;
42 }System.arraycopy (this.buf, this.pos, b, off, avail);
47 len = this.$in.read (b, off, len);
49 return avail == 0 ? -1 : avail;
53 Clazz.defineMethod (c$, "unreadByte",
57 throw new java.io.IOException ("Push back buffer is full");
58 }this.buf[--this.pos] = b;
60 Clazz.defineMethod (c$, "unread",
61 function (b, off, len) {
64 throw new java.io.IOException ("Push back buffer is full");
66 System.arraycopy (b, off, this.buf, this.pos, len);
68 Clazz.overrideMethod (c$, "available",
71 var n = this.buf.length - this.pos;
72 var avail = this.$in.available ();
73 return n > (2147483647 - avail) ? 2147483647 : n + avail;
75 Clazz.overrideMethod (c$, "skip",
80 }var pskip = this.buf.length - this.pos;
87 pskip += this.$in.skip (n);
90 Clazz.overrideMethod (c$, "markSupported",
94 Clazz.overrideMethod (c$, "mark",
95 function (readlimit) {
97 Clazz.overrideMethod (c$, "reset",
99 throw new java.io.IOException ("mark/reset not supported");
101 Clazz.overrideMethod (c$, "close",
103 if (this.$in == null) return;