Preparing for callback testing (creating new policy files); Adding error messsages...
[iot2.git] / iotjava / iotrmi / Java / IoTRMIUtil.java
index bcb2975298134d3a4f933104f3c6e10d281bcb05..23385ba5199947039f7d68d398cb95fc4c02b063 100644 (file)
@@ -40,6 +40,7 @@ public class IoTRMIUtil {
        public final static int OBJECT_ID_LEN = 4;      // 4 bytes = 32 bits
        public final static int METHOD_ID_LEN = 4;      // 4 bytes = 32 bits
        public final static int PARAM_LEN = 4;          // 4 bytes = 32 bits (4-byte field that stores the length of the param)
+       public final static int RETURN_LEN = 4;         // 4 bytes = 32 bits (4-byte field that stores the length of the return object)
 
        public final static int SHT_LEN = 2;
        public final static int INT_LEN = 4;
@@ -261,7 +262,7 @@ public class IoTRMIUtil {
                } else if ( (type == String[].class) ||
                                        (type == String.class)) {
                        retObj = (Object) byteArrayToStringArray(paramBytes);
-               } else if (type.isArray()) {
+               //} else if (type.isArray()) {
                // This is an array but it's more than 1 dimension, e.g. 2-dimensional,
                //              3-dimensional, etc.
                        // for loop to check inner array perhaps using object
@@ -282,7 +283,7 @@ public class IoTRMIUtil {
                
                byte[] retObjBytes = null;
                if (obj instanceof Byte) {
-                       retObjBytes = (byte[]) obj;
+                       retObjBytes = new byte[] { (byte) obj };
                } else if (obj instanceof Short) {
                        retObjBytes = shortToByteArray((short) obj);
                } else if (obj instanceof Integer) {