Exemplo n.º 1
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);
     }
 }
Exemplo n.º 2
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);
     }
 }