-// Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL]
+// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
package org.xwt;
import java.io.*;
objects.setElementAt(new Double(new String(content.getBuf(), 0, content.size())), objects.size() - 1);
else if (c.localName.equals("base64"))
- objects.setElementAt(new ByteStream(Base64.decode(new String(content.getBuf(), 0, content.size()))), objects.size() - 1);
-
+ objects.setElementAt(new Res.ByteArray(Base64.decode(new String(content.getBuf(), 0, content.size()))), objects.size() - 1);
+
else if (c.localName.equals("name"))
objects.addElement(new String(content.getBuf(), 0, content.size()));
sb.append(((Boolean)o).booleanValue() ? "1" : "0");
sb.append("</boolean></value>\n");
- } else if (o instanceof ByteStream) {
+ } else if (o instanceof Res) {
try {
sb.append(" <value><base64>\n");
- InputStream is = ((ByteStream)o).getInputStream();
+ InputStream is = ((Res)o).getInputStream();
byte[] buf = new byte[54];
while(true) {
int numread = is.read(buf, 0, 54);
/*
} else if (o instanceof org.xwt.js.Date) {
sb.append(" <value><dateTime.iso8601>");
- FIXME
org.xwt.js.Date d = (org.xwt.js.Date)o;
Date d = new Date(nd.getRawTime());
sb.append(d.getYear() + 1900);
while ((s = br2.readLine()) != null) Log.log(this, "send: " + s);
}
- HTTP.HTTPInputStream is = http.POST("text/xml", content);
+ InputStream is = http.POST("text/xml", content);
try {
BufferedReader br = !Log.verbose ?
new BufferedReader(new InputStreamReader(new Filter(is))) :
}
/** When you get a property from an XMLRPC, it just returns another XMLRPC with the property name tacked onto methodname. */
- public Object get(String name) {
- return new XMLRPC(url, (methodname.equals("") ? "" : methodname + ".") + name, http);
+ public Object get(Object name) {
+ return new XMLRPC(url, (methodname.equals("") ? "" : methodname + ".") + name.toString(), http);
}
public XMLRPC(String url, String methodname) {
public Filter(InputStream is) { super(is); }
public int read() throws IOException {
java.lang.Thread.yield();
- while(MessageQueue.nonThreadEventsInQueue > 0) try { java.lang.Thread.sleep(100); } catch (Exception e) { };
+ while(Message.Q.nonThreadEventsInQueue > 0) try { java.lang.Thread.sleep(100); } catch (Exception e) { };
return super.read();
}
public int read(byte[] b) throws IOException {
java.lang.Thread.yield();
- while(MessageQueue.nonThreadEventsInQueue > 0) try { java.lang.Thread.sleep(100); } catch (Exception e) { };
+ while(Message.Q.nonThreadEventsInQueue > 0) try { java.lang.Thread.sleep(100); } catch (Exception e) { };
return super.read(b);
}
public int read(byte[] b, int i, int j) throws IOException {
java.lang.Thread.yield();
- while(MessageQueue.nonThreadEventsInQueue > 0) try { java.lang.Thread.sleep(100); } catch (Exception e) { };
+ while(Message.Q.nonThreadEventsInQueue > 0) try { java.lang.Thread.sleep(100); } catch (Exception e) { };
return super.read(b, i, j);
}
}