Example #1
0
 public override FieldValue Decode(System.IO.Stream in_Renamed, Group decodeTemplate, Context context, BitVectorReader presenceMapReader)
 {
     try
     {
         ScalarValue previousValue = null;
         if (operator_Renamed.UsesDictionary())
         {
             previousValue = context.Lookup(Dictionary, decodeTemplate, Key);
             ValidateDictionaryTypeAgainstFieldType(previousValue, type);
         }
         ScalarValue value_Renamed;
         int         pmapIndex = presenceMapReader.Index;
         if (IsPresent(presenceMapReader))
         {
             if (context.TraceEnabled)
             {
                 in_Renamed = new RecordingInputStream(in_Renamed);
             }
             if (!operatorCodec.ShouldDecodeType())
             {
                 return(operatorCodec.DecodeValue(null, null, this));
             }
             ScalarValue decodedValue = typeCodec.Decode(in_Renamed);
             value_Renamed = DecodeValue(decodedValue, previousValue);
             if (context.TraceEnabled)
             {
                 context.DecodeTrace.Field(this, value_Renamed, decodedValue, ((RecordingInputStream)in_Renamed).Buffer, pmapIndex);
             }
         }
         else
         {
             value_Renamed = Decode(previousValue);
         }
         ValidateDecodedValueIsCorrectForType(value_Renamed, type);
         if (!((Operator == Template.Operator.Operator.DELTA) && (value_Renamed == null)))
         {
             context.Store(Dictionary, decodeTemplate, Key, value_Renamed);
         }
         return(value_Renamed);
     }
     catch (FastException e)
     {
         throw new FastException("Error occurred while decoding " + this, e.Code, e);
     }
 }