1 Clazz.declarePackage ("JU");
\r
2 Clazz.load (["java.net.URLConnection"], "JU.AjaxURLConnection", ["JU.AU", "$.Rdr", "$.SB"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.bytesOut = null;
\r
6 Clazz.instantialize (this, arguments);
\r
7 }, JU, "AjaxURLConnection", java.net.URLConnection);
\r
8 Clazz.defineMethod (c$, "doAjax",
\r
11 return Jmol._doAjax(this.url, this.postOut, this.bytesOut);
\r
13 Clazz.overrideMethod (c$, "connect",
\r
16 Clazz.defineMethod (c$, "outputBytes",
\r
18 this.bytesOut = bytes;
\r
20 Clazz.defineMethod (c$, "outputString",
\r
22 this.postOut = post;
\r
24 Clazz.overrideMethod (c$, "getInputStream",
\r
27 var o = this.doAjax ();
\r
28 if (JU.AU.isAB (o)) is = JU.Rdr.getBIS (o);
\r
29 else if (Clazz.instanceOf (o, JU.SB)) is = JU.Rdr.getBIS (JU.Rdr.getBytesFromSB (o));
\r
30 else if (Clazz.instanceOf (o, String)) is = JU.Rdr.getBIS ((o).getBytes ());
\r
33 Clazz.defineMethod (c$, "getContents",
\r
35 return this.doAjax ();
\r