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