public virtual void TestReadByte()
        {
            var aByte = reader.ReadByte("byte");

            Assert.AreEqual(1, aByte);
            Assert.AreEqual(0, reader.ReadByte("NO SUCH FIELD"));
        }
 /// <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");
 }
Пример #4
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");
 }
Пример #5
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");
 }
            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");
            }