1 Clazz.load (["java.io.Reader"], "java.io.StringReader", ["java.io.IOException", "java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException"], function () {
\r
2 c$ = Clazz.decorateAsClass (function () {
\r
7 Clazz.instantialize (this, arguments);
\r
8 }, java.io, "StringReader", java.io.Reader);
\r
9 Clazz.makeConstructor (c$,
\r
11 Clazz.superConstructor (this, java.io.StringReader, [s]);
\r
13 this.length = s.length;
\r
15 Clazz.defineMethod (c$, "ensureOpen",
\r
17 if (this.str == null) throw new java.io.IOException ("Stream closed");
\r
19 Clazz.overrideMethod (c$, "read",
\r
20 function (cbuf, off, len) {
\r
23 if ((off < 0) || (off > cbuf.length) || (len < 0) || ((off + len) > cbuf.length) || ((off + len) < 0)) {
\r
24 throw new IndexOutOfBoundsException ();
\r
25 } else if (len == 0) {
\r
27 }if (this.next >= this.length) return -1;
\r
28 var n = Math.min (this.length - this.next, len);
\r
29 this.str.getChars (this.next, this.next + n, cbuf, off);
\r
33 Clazz.overrideMethod (c$, "skip",
\r
37 if (this.next >= this.length) return 0;
\r
38 var n = Math.min (this.length - this.next, ns);
\r
39 n = Math.max (-this.next, n);
\r
43 Clazz.overrideMethod (c$, "ready",
\r
49 Clazz.overrideMethod (c$, "markSupported",
\r
53 Clazz.overrideMethod (c$, "mark",
\r
54 function (readAheadLimit) {
\r
55 if (readAheadLimit < 0) {
\r
56 throw new IllegalArgumentException ("Read-ahead limit < 0");
\r
59 this.$mark = this.next;
\r
61 Clazz.overrideMethod (c$, "reset",
\r
65 this.next = this.$mark;
\r
67 Clazz.overrideMethod (c$, "close",
\r