2003/09/23 08:24:59
[org.ibex.core.git] / src / org / xwt / XMLRPC.java
index f11413c..40fbb23 100644 (file)
@@ -103,11 +103,8 @@ class XMLRPC extends JS.Callable {
             else if (c.localName.equals("double"))
                 objects.setElementAt(new Double(new String(content.getBuf(), 0, content.size())), objects.size() - 1);
             
-            // FIXME
-            /*
             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()));
@@ -199,12 +196,10 @@ class XMLRPC extends JS.Callable {
             sb.append(((Boolean)o).booleanValue() ? "1" : "0");
             sb.append("</boolean></value>\n");
 
-            //FIXME
-            /*
-        } 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);
@@ -224,7 +219,6 @@ class XMLRPC extends JS.Callable {
                 if (Log.on) Log.log(this, e);
                 throw new JS.Exn("caught IOException while attempting to send a ByteStream via XML-RPC");
             }
-            */
 
         } else if (o instanceof String) {
             sb.append("                <value><string>");
@@ -420,17 +414,17 @@ class XMLRPC extends JS.Callable {
         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);
         }
     }