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