示例#1
0
        public override FieldValue Decode(System.IO.Stream in_Renamed, Group decodeTemplate, Context context, BitVectorReader pmapReader)
        {
            var        sequenceValue = new SequenceValue(this);
            FieldValue lengthValue   = length.Decode(in_Renamed, decodeTemplate, context, pmapReader);

            if ((lengthValue == ScalarValue.NULL) || (lengthValue == null))
            {
                return(null);
            }

            int len = ((IntegerValue)lengthValue).value_Renamed;

            for (var i = 0; i < len; i++)
            {
                sequenceValue.Add((GroupValue)group.Decode(in_Renamed, decodeTemplate, context, BitVectorReader.INFINITE_TRUE));
            }

            return(sequenceValue);
        }
示例#2
0
        public override IFieldValue Decode(Stream inStream, Group decodeTemplate, Context context,
                                           BitVectorReader pmapReader)
        {
            var         sequenceValue = new SequenceValue(this);
            IFieldValue lengthValue   = _length.Decode(inStream, decodeTemplate, context, pmapReader);

            if ((lengthValue == ScalarValue.Null) || (lengthValue == null))
            {
                return(null);
            }

            int len = ((IntegerValue)lengthValue).Value;

            for (int i = 0; i < len; i++)
            {
                sequenceValue.Add(
                    (GroupValue)_group.Decode(inStream, decodeTemplate, context, BitVectorReader.InfiniteTrue));
            }

            return(sequenceValue);
        }