public virtual void TestReadBoolean()
        {
            var aBoolean = reader.ReadBoolean("boolean");

            Assert.IsTrue(aBoolean);
            Assert.IsFalse(reader.ReadBoolean("NO SUCH FIELD"));
        }
Esempio n. 2
0
        public void ReadPortable(IPortableReader reader)
        {
            Id = reader.ReadLong("Id");

            Text0 = reader.ReadUTF("Text0");
            Text1 = reader.ReadUTF("Text1");
            Text2 = reader.ReadUTF("Text2");
            Text3 = reader.ReadUTF("Text3");
            Text4 = reader.ReadUTF("Text4");
            Text5 = reader.ReadUTF("Text5");
            Text6 = reader.ReadUTF("Text6");
            Text7 = reader.ReadUTF("Text7");
            Text8 = reader.ReadUTF("Text8");
            Text9 = reader.ReadUTF("Text9");

            Boolean0 = reader.ReadBoolean("Boolean0");
            Boolean1 = reader.ReadBoolean("Boolean1");
            Boolean2 = reader.ReadBoolean("Boolean2");
            Boolean3 = reader.ReadBoolean("Boolean3");
            Boolean4 = reader.ReadBoolean("Boolean4");

            TimeStamp0 = reader.ReadLong("TimeStamp0");
            TimeStamp1 = reader.ReadLong("TimeStamp1");
            TimeStamp2 = reader.ReadLong("TimeStamp2");
            TimeStamp3 = reader.ReadLong("TimeStamp3");
            TimeStamp4 = reader.ReadLong("TimeStamp4");

            TextArray = reader.ReadUTFArray("TextArray");
            DataArray = reader.ReadByteArray("ByteArray");
        }
 public void ReadPortable(IPortableReader reader)
 {
     if (reader.ReadBoolean("_has__data"))
     {
         Data = reader.ReadUTF("data");
     }
 }
Esempio n. 4
0
            /** <inheritdoc /> */
            public void ReadPortable(IPortableReader reader)
            {
                ThrowOnRead = reader.ReadBoolean("ThrowOnRead");

                if (ThrowOnRead)
                {
                    throw new Exception("Expected exception in CustomExceptionPortable.ReadPortable");
                }
            }
Esempio n. 5
0
            /** <inheritdoc /> */
            public void ReadPortable(IPortableReader reader)
            {
                Prop        = reader.ReadString("Prop");
                ThrowOnRead = reader.ReadBoolean("ThrowOnRead");

                if (ThrowOnRead)
                {
                    throw new Exception("Expected exception in TestPortableClass.ReadPortable");
                }
            }
 /// <exception cref="System.IO.IOException"/>
 public virtual void ReadPortable(IPortableReader reader)
 {
     aByte = reader.ReadByte("byte");
     aBoolean = reader.ReadBoolean("boolean");
     character = reader.ReadChar("char");
     aShort = reader.ReadShort("short");
     integer = reader.ReadInt("int");
     aLong = reader.ReadLong("long");
     aFloat = reader.ReadFloat("float");
     aDouble = reader.ReadDouble("double");
     aString = reader.ReadUTF("string");
 }
 /// <exception cref="System.IO.IOException"/>
 public virtual void ReadPortable(IPortableReader reader)
 {
     aByte     = reader.ReadByte("byte");
     aBoolean  = reader.ReadBoolean("boolean");
     character = reader.ReadChar("char");
     aShort    = reader.ReadShort("short");
     integer   = reader.ReadInt("int");
     aLong     = reader.ReadLong("long");
     aFloat    = reader.ReadFloat("float");
     aDouble   = reader.ReadDouble("double");
     aString   = reader.ReadUTF("string");
 }
Esempio n. 8
0
 public void ReadPortable(IPortableReader reader)
 {
     b   = reader.ReadByte("b");
     bo  = reader.ReadBoolean("bool");
     c   = reader.ReadChar("c");
     s   = reader.ReadShort("s");
     i   = reader.ReadInt("i");
     l   = reader.ReadLong("l");
     f   = reader.ReadFloat("f");
     d   = reader.ReadDouble("d");
     str = reader.ReadUTF("str");
     p   = reader.ReadPortable <InnerPortable>("p");
 }
Esempio n. 9
0
 public void ReadPortable(IPortableReader reader)
 {
     Bool        = reader.ReadBoolean("bool");
     BoolArray   = reader.ReadBooleanArray("boolArray");
     Byte        = reader.ReadByte("byte");
     ByteArray   = reader.ReadByteArray("byteArray");
     Char        = reader.ReadChar("char");
     CharArray   = reader.ReadCharArray("charArray");
     Short       = reader.ReadShort("short");
     ShortArray  = reader.ReadShortArray("shortArray");
     Int         = reader.ReadInt("int");
     IntArray    = reader.ReadIntArray("intArray");
     Long        = reader.ReadLong("long");
     LongArray   = reader.ReadLongArray("longArray");
     Float       = reader.ReadFloat("float");
     FloatArray  = reader.ReadFloatArray("floatArray");
     Double      = reader.ReadDouble("double");
     DoubleArray = reader.ReadDoubleArray("doubleArray");
     String      = reader.ReadUTF("string");
     StringArray = reader.ReadUTFArray("stringArray");
 }
 public void ReadPortable(IPortableReader reader)
 {
     Bool = reader.ReadBoolean("bool");
     BoolArray = reader.ReadBooleanArray("boolArray");
     Byte = reader.ReadByte("byte");
     ByteArray = reader.ReadByteArray("byteArray");
     Char = reader.ReadChar("char");
     CharArray = reader.ReadCharArray("charArray");
     Short = reader.ReadShort("short");
     ShortArray = reader.ReadShortArray("shortArray");
     Int = reader.ReadInt("int");
     IntArray = reader.ReadIntArray("intArray");
     Long = reader.ReadLong("long");
     LongArray = reader.ReadLongArray("longArray");
     Float = reader.ReadFloat("float");
     FloatArray = reader.ReadFloatArray("floatArray");
     Double = reader.ReadDouble("double");
     DoubleArray = reader.ReadDoubleArray("doubleArray");
     String = reader.ReadUTF("string");
     StringArray = reader.ReadUTFArray("stringArray");
 }
 public void ReadPortable(IPortableReader reader)
 {
     b = reader.ReadByte("b");
     bo = reader.ReadBoolean("bool");
     c = reader.ReadChar("c");
     s = reader.ReadShort("s");
     i = reader.ReadInt("i");
     l = reader.ReadLong("l");
     f = reader.ReadFloat("f");
     d = reader.ReadDouble("d");
     str = reader.ReadUTF("str");
     p = reader.ReadPortable<InnerPortable>("p");
 }
Esempio n. 12
0
 public void ReadPortable(IPortableReader reader)
 {
     _username = reader.ReadUTF("username");
     _age      = reader.ReadInt("age");
     _active   = reader.ReadBoolean("active");
 }
Esempio n. 13
0
        public void ReadPortable(IPortableReader reader)
        {
            model_body = reader.ReadUTF("f0");
            model_engine_position = reader.ReadUTF("f1");
            model_engine_cc = reader.ReadInt("f2");
            model_engine_cyl = reader.ReadInt("f3");
            model_engine_type = reader.ReadUTF("f4");

            model_engine_valves_per_cyl = reader.ReadInt("f5");
            model_engine_power_ps = reader.ReadInt("f6");
            model_engine_power_rpm = reader.ReadInt("f7");
            model_engine_torque_nm = reader.ReadInt("f8");
            model_engine_torque_rpm = reader.ReadInt("f9");
            model_engine_bore_mm = reader.ReadInt("f10");
            model_engine_stroke_mm = reader.ReadInt("f11");
            model_engine_compression = reader.ReadUTF("f12");
            model_engine_fuel = reader.ReadUTF("f13");

            model_top_speed_kph = reader.ReadInt("f14");
            model_0_to_100_kph = reader.ReadFloat("f15");
            model_drive = reader.ReadUTF("f16");
            model_transmission_type = reader.ReadUTF("f17");
            model_seats = reader.ReadInt("f18");
            model_doors = reader.ReadInt("f19");
            model_weight_kg = reader.ReadInt("f20");
            model_length_mm = reader.ReadInt("f21");
            model_height_mm = reader.ReadInt("f22");
            model_width_mm = reader.ReadInt("f23");
            model_wheelbase_mm = reader.ReadInt("f24");

            model_lkm_hwy = reader.ReadFloat("f25");
            model_lkm_mixed = reader.ReadFloat("f26");
            model_lkm_city = reader.ReadFloat("f27");
            model_fuel_cap_l = reader.ReadInt("f28");
            model_sold_in_us = reader.ReadBoolean("f29");
            model_co2 = reader.ReadFloat("f30");
            model_make_display = reader.ReadUTF("f31");
            make_display = reader.ReadUTF("f32");
            make_country = reader.ReadUTF("f33");
        }
            public unsafe void ReadPortable(object obj, IPortableReader reader)
            {
                PrimitiveFieldType obj0 = (PrimitiveFieldType)obj;

                obj0.PBool = reader.ReadBoolean("bool");
                obj0.PByte = reader.ReadByte("byte");
                obj0.PShort = reader.ReadShort("short");
                obj0.PInt = reader.ReadInt("int");

                obj0.PLong = reader.ReadLong("long");
                obj0.PChar = reader.ReadChar("char");
                obj0.PFloat = reader.ReadFloat("float");
                obj0.PDouble = reader.ReadDouble("double");

                byte sByte = reader.ReadByte("sbyte");
                short uShort = reader.ReadShort("ushort");
                int uInt = reader.ReadInt("uint");
                long uLong = reader.ReadLong("ulong");

                obj0.PSbyte = *(sbyte*)&sByte;
                obj0.PUshort = *(ushort*)&uShort;
                obj0.PUint = *(uint*)&uInt;
                obj0.PUlong = *(ulong*)&uLong;

                obj0.PString = reader.ReadString("string");
                obj0.PGuid = reader.ReadGuid("guid").Value;
                obj0.PnGuid = reader.ReadGuid("nguid");
            }
            public unsafe void ReadPortable(IPortableReader reader)
            {
                PBool = reader.ReadBoolean("bool");
                PByte = reader.ReadByte("byte");
                PShort = reader.ReadShort("short");
                PInt = reader.ReadInt("int");

                PLong = reader.ReadLong("long");
                PChar = reader.ReadChar("char");
                PFloat = reader.ReadFloat("float");
                PDouble = reader.ReadDouble("double");

                byte sByte = reader.ReadByte("sbyte");
                short uShort = reader.ReadShort("ushort");
                int uInt = reader.ReadInt("uint");
                long uLong = reader.ReadLong("ulong");

                PSbyte = *(sbyte*)&sByte;
                PUshort = *(ushort*)&uShort;
                PUint = *(uint*)&uInt;
                PUlong = *(ulong*)&uLong;

                PString = reader.ReadString("string");
                PGuid = reader.ReadGuid("guid").Value;
                PnGuid = reader.ReadGuid("nguid");
            }