示例#1
0
        private static Int32 parseBoolArray(Int32 eox, Int32 offset, ref Byte[] buffer, ref Rexp x)
        {
            Int32 Count = getLength(ref buffer, offset);

            offset += 4;
            Int32 i = 0;

            Rbool[] values = new Rbool[Count];

            while ((offset < eox) && (i < Count))
            {
                values[i] = new Rbool((RBoolValues)buffer[offset]);
                i++;
                offset++;
            }

            // skip the padding
            while ((i & 3) != 0)
            {
                i++;
                offset++;
            }
            x.Data = values;
            if (offset > buffer.Length)
            {
                throw new Exception("bladBArray");
            }

            return(offset);
        }
示例#2
0
        private static Int32 parseBoolArrayUA(Int32 eox, Int32 offset, ref Byte[] buffer, ref Rexp x)
        {
            Int32 Count = (eox - offset);

            x.Xtype = Xpression.XT_ARRAY_BOOL; // XT_ARRAY_BOOL_UA is only old transport type for XT_ARRAY_BOOL
            Rbool[] values = new Rbool[Count];

            for (int i = 0; i < Count; i++)
            {
                values[i] = new Rbool((RBoolValues)buffer[offset]);
                offset++;
            }

            x.Data = values;
            if (offset > buffer.Length)
            {
                throw new Exception("bladBArrayU");
            }

            return(offset);
        }
示例#3
0
        private static Int32 parseBoolArrayUA(Int32 eox, Int32 offset, ref Byte[] buffer, ref Rexp x)
        {
            Int32 Count = (eox - offset);
            x.Xtype = Xpression.XT_ARRAY_BOOL; // XT_ARRAY_BOOL_UA is only old transport type for XT_ARRAY_BOOL
            Rbool[] values = new Rbool[Count];

            for (int i = 0; i < Count; i++)
            {
                values[i] = new Rbool((RBoolValues)buffer[offset]);
                offset++;
            }

            x.Data = values;
            if (offset > buffer.Length) throw new Exception("bladBArrayU");

            return offset;
        }
示例#4
0
        private static Int32 parseBoolArray(Int32 eox, Int32 offset, ref Byte[] buffer, ref Rexp x)
        {
            Int32 Count = getLength(ref buffer, offset);
            offset += 4;
            Int32 i = 0;
            Rbool[] values = new Rbool[Count];

            while ((offset < eox) && (i < Count))
            {
                values[i] = new Rbool((RBoolValues)buffer[offset]);
                i++;
                offset++;
            }

            // skip the padding
            while ((i & 3) != 0)
            {
                i++;
                offset++;
            }
            x.Data = values;
            if (offset > buffer.Length) throw new Exception("bladBArray");

            return offset;
        }