예제 #1
0
        public override ScalarValue Decode(Stream inStream)
        {
            int      intValue = ((IntegerValue)Uint.Decode(inStream)).Value;
            DateTime tempAux  = Util.ToTimestamp(intValue);

            return(new DateValue(tempAux));
        }
예제 #2
0
        public override ScalarValue Decode(Stream inStream)
        {
            long longValue = Uint.Decode(inStream).ToLong();
            var  year      = (int)(longValue / 10000);
            var  month     = (int)((longValue - (year * 10000)) / 100);
            var  day       = (int)(longValue % 100);

            return(new DateValue(new DateTime(year, month, day)));
        }
        public override ScalarValue Decode(Stream inStream)
        {
            var value = (NumericValue)Uint.Decode(inStream);

            if (value.EqualsInt(0))
            {
                return(null);
            }

            return(value.Decrement());
        }
예제 #4
0
        public override ScalarValue Decode(Stream inStream)
        {
            int intValue = ((IntegerValue)Uint.Decode(inStream)).Value;
            int hour     = intValue / 10000000;

            intValue -= hour * 10000000;
            int minute = intValue / 100000;

            intValue -= minute * 100000;
            int second = intValue / 1000;

            intValue -= second * 1000;
            int millisecond = intValue % 1000;
            var tempAux     = new DateTime(hour * 3600000 + minute * 60000 + second * 1000 + millisecond);

            return(new DateValue(tempAux));
        }
예제 #5
0
 public override ScalarValue Decode(Stream inStream)
 {
     try
     {
         int length   = ((IntegerValue)Uint.Decode(inStream)).Value;
         var encoding = new byte[length];
         for (int i = 0; i < length; i++)
         {
             encoding[i] = (byte)inStream.ReadByte();
         }
         return(new ByteVectorValue(encoding));
     }
     catch (IOException e)
     {
         throw new RuntimeException(e);
     }
 }