Ejemplo n.º 1
0
 public override object ReadValue(HessianReader reader, HessianContext context, Type objectType, byte initialOctet)
 {
     if (0x80 <= initialOctet && initialOctet <= 0xbf)
     {
         return(initialOctet - 0x90);
     }
     else if (0xc0 <= initialOctet && initialOctet <= 0xcf)
     {
         var b0 = reader.ReadByte();
         return(((initialOctet - 0xc8) << 8) + b0);
     }
     else if (0xd0 <= initialOctet && initialOctet <= 0xd7)
     {
         var s = reader.ReadUInt16();
         return(((initialOctet - 0xd4) << 16) + s);
     }
     else if (Constants.BC_INT == initialOctet)
     {
         return(reader.ReadInt32());
     }
     else
     {
         throw Exceptions.UnExpectedInitialOctet(this, initialOctet);
     }
 }
Ejemplo n.º 2
0
 public override object ReadValue(HessianReader reader, HessianContext context, Type objectType, byte initialOctet)
 {
     if (initialOctet == Constants.BC_DOUBLE_ZERO)
     {
         return(0d);
     }
     else if (initialOctet == Constants.BC_DOUBLE_ONE)
     {
         return(1d);
     }
     else if (initialOctet == Constants.BC_DOUBLE_BYTE)
     {
         return((double)reader.ReadSByte());
     }
     else if (initialOctet == Constants.BC_DOUBLE_SHORT)
     {
         return((double)reader.ReadInt16());
     }
     else if (initialOctet == Constants.BC_DOUBLE_MILL)
     {
         return(reader.ReadInt32() / 1000.0d);
     }
     else if (initialOctet == Constants.BC_DOUBLE)
     {
         return(reader.ReadDouble());
     }
     else
     {
         throw Exceptions.UnExpectedInitialOctet(this, initialOctet);
     }
 }
Ejemplo n.º 3
0
 public override object ReadValue(HessianReader reader, HessianContext context, Type objectType, byte initialOctet)
 {
     if (0xd8 <= initialOctet && initialOctet <= 0xef)
     {
         return((long)(initialOctet - 0xe0));
     }
     else if (0xf0 <= initialOctet && initialOctet <= 0xff)
     {
         var b0 = reader.ReadByte();
         return((long)(((initialOctet - 0xf8) << 8) + b0));
     }
     else if (0x38 <= initialOctet && initialOctet <= 0x3f)
     {
         var s = reader.ReadUInt16();
         return((long)(((initialOctet - 0x3c) << 16) + s));
     }
     else if (Constants.BC_LONG_INT == initialOctet)
     {
         return((long)reader.ReadInt32());
     }
     else if (Constants.BC_LONG == initialOctet)
     {
         return(reader.ReadInt64());
     }
     else
     {
         throw Exceptions.UnExpectedInitialOctet(this, initialOctet);
     }
 }
Ejemplo n.º 4
0
 public override object ReadValue(HessianReader reader, HessianContext context, Type objectType, byte initialOctet)
 {
     if (initialOctet == Constants.BC_DATE)
     {
         var timeStamp = reader.ReadInt64();
         return(BeginDate.AddTicks(timeStamp * 10000));
     }
     else if (initialOctet == Constants.BC_DATE_MINUTE)
     {
         var minutes = reader.ReadInt32();
         return(BeginDate.AddMinutes(minutes));
     }
     else
     {
         throw Exceptions.UnExpectedInitialOctet(this, initialOctet);
     }
 }