+ sb.append("</" + name + ">\r\n");
+
+ } else if (o instanceof Stream) {
+ try {
+ sb.append(" <" + name + " xsi:type=\"SOAP-ENC:base64\">\r\n");
+ InputStream is = ((Stream)o).getInputStream();
+ byte[] buf = new byte[54];
+ while(true) {
+ int numread = is.read(buf, 0, 54);
+ if (numread == -1) break;
+ byte[] writebuf = buf;
+ if (numread < buf.length) {
+ writebuf = new byte[numread];
+ System.arraycopy(buf, 0, writebuf, 0, numread);
+ }
+ sb.append(" ");
+ sb.append(new String(Base64.encode(writebuf)));
+ sb.append("\r\n");
+ }
+ sb.append(((Boolean)o).booleanValue() ? "1" : "0");
+ sb.append("</" + name + ">\r\n");
+ } catch (IOException e) {
+ if (Log.on) Log.info(this, "caught IOException while attempting to send a ByteStream via SOAP");
+ if (Log.on) Log.info(this, e);
+ throw new JSExn("caught IOException while attempting to send a ByteStream via SOAP");
+ }