Ejemplo n.º 1
0
        // server call
        public override void setByteData(byte[] buf)
        {
            TransferInputStream tins = new TransferInputStream(buf);

            this.calleeClass  = tins.readString();
            this.calleeMethod = tins.readString();
            this.returnType   = tins.readByte();
            this.compress     = tins.readBoolean();

            while (!tins.isFinished())
            {
                byte type = tins.readByte();
                if (type == DATATYPE_BOOLEAN)
                {
                    putBoolean(tins.readBoolean());
                }
                else if (type == DATATYPE_BYTE)
                {
                    putByte(tins.readByte());
                }
                else if (type == DATATYPE_SHORT)
                {
                    putShort(tins.readShort());
                }
                else if (type == DATATYPE_CHAR)
                {
                    putChar(tins.readChar());
                }
                else if (type == DATATYPE_INT)
                {
                    putInt(tins.readInt());
                }
                else if (type == DATATYPE_LONG)
                {
                    putLong(tins.readLong());
                }
                else if (type == DATATYPE_FLOAT)
                {
                    putFloat(tins.readFloat());
                }
                else if (type == DATATYPE_DOUBLE)
                {
                    putDouble(tins.readDouble());
                }
                else if (type == DATATYPE_DATE)
                {
                    putDate(tins.readDate());
                }
                else if (type == DATATYPE_STRING)
                {
                    putString(tins.readString());
                }
                else if (type == DATATYPE_BYTEARRAY)
                {
                    putByteArray(tins.readByteArray());
                }
                else if (type == DATATYPE_INTARRAY)
                {
                    putIntArray(tins.readIntArray());
                }
                else if (type == DATATYPE_LONGARRAY)
                {
                    putLongArray(tins.readLongArray());
                }
                else if (type == DATATYPE_FLOATARRAY)
                {
                    putFloatArray(tins.readFloatArray());
                }
                else if (type == DATATYPE_DOUBLEARRAY)
                {
                    putDoubleArray(tins.readDoubleArray());
                }
                else if (type == DATATYPE_STRINGARRAY)
                {
                    putStringArray(tins.readStringArray());
                }
                else if (type == DATATYPE_WRAPPER)
                {
                    putWrapper(tins.readWrapper());
                }
            }
        }
Ejemplo n.º 2
0
        public static Object convertReturnByteArray(byte[] buf)
        {
            Object returnObject = null;

            TransferInputStream tins = new TransferInputStream(buf);
            byte returnType          = tins.readByte();

            if (returnType == DATATYPE_BOOLEAN)
            {
                returnObject = tins.readBoolean();
            }
            else if (returnType == DATATYPE_BYTE)
            {
                returnObject = tins.readByte();
            }
            else if (returnType == DATATYPE_SHORT)
            {
                returnObject = tins.readShort();
            }
            else if (returnType == DATATYPE_CHAR)
            {
                returnObject = tins.readChar();
            }
            else if (returnType == DATATYPE_INT)
            {
                returnObject = tins.readInt();
            }
            else if (returnType == DATATYPE_LONG)
            {
                returnObject = tins.readLong();
            }
            else if (returnType == DATATYPE_FLOAT)
            {
                returnObject = tins.readFloat();
            }
            else if (returnType == DATATYPE_DOUBLE)
            {
                returnObject = tins.readDouble();
            }
            else if (returnType == DATATYPE_DATE)
            {
                returnObject = tins.readDate();
            }
            else if (returnType == DATATYPE_STRING)
            {
                returnObject = tins.readString();
            }
            else if (returnType == DATATYPE_WRAPPER)
            {
                returnObject = (TransferObjectWrapper)tins.readWrapper();
            }
            else if (returnType == DATATYPE_VOID)
            {
                returnObject = null;
            }
            else if (returnType == DATATYPE_BYTEARRAY)
            {
                returnObject = tins.readByteArray();
            }
            else if (returnType == DATATYPE_INTARRAY)
            {
                returnObject = tins.readIntArray();
            }
            else if (returnType == DATATYPE_LONGARRAY)
            {
                returnObject = tins.readLongArray();
            }
            else if (returnType == DATATYPE_FLOATARRAY)
            {
                returnObject = tins.readFloatArray();
            }
            else if (returnType == DATATYPE_DOUBLEARRAY)
            {
                returnObject = tins.readDoubleArray();
            }
            else if (returnType == DATATYPE_STRINGARRAY)
            {
                returnObject = tins.readStringArray();
            }

            return(returnObject);
        }