Пример #1
0
            public CompositeAvailableCapacity Decode(BitArrayInputStream input)
            {
                CompositeAvailableCapacity capacity = new CompositeAvailableCapacity();

                capacity.InitDefaults();
                BitMaskStream stream = (input.readBit() != 0) ? new BitMaskStream(input, 2) : new BitMaskStream(input, 2);

                if (stream.Read())
                {
                    input.readBit();
                    capacity.cellCapacityClassValue = input.readBits(7) + 1;
                }
                capacity.capacityValue = input.readBits(7);
                if (stream.Read())
                {
                    input.skipUnreadedBits();
                    capacity.iE_Extensions = new List <ProtocolExtensionField>();
                    const int nBits = 0x10;
                    int       num5  = input.readBits(nBits) + 1;
                    for (int i = 0; i < num5; i++)
                    {
                        ProtocolExtensionField item = ProtocolExtensionField.PerDecoder.Instance.Decode(input);
                        capacity.iE_Extensions.Add(item);
                    }
                }
                return(capacity);
            }
Пример #2
0
 public CompositeAvailableCapacity Decode(BitArrayInputStream input)
 {
     CompositeAvailableCapacity capacity = new CompositeAvailableCapacity();
     capacity.InitDefaults();
     BitMaskStream stream = (input.ReadBit() != 0) ? new BitMaskStream(input, 2) : new BitMaskStream(input, 2);
     if (stream.Read())
     {
         input.ReadBit();
         capacity.cellCapacityClassValue = input.ReadBits(7) + 1;
     }
     capacity.capacityValue = input.ReadBits(7);
     if (stream.Read())
     {
         input.skipUnreadedBits();
         capacity.iE_Extensions = new List<ProtocolExtensionField>();
         const int nBits = 0x10;
         int num5 = input.ReadBits(nBits) + 1;
         for (int i = 0; i < num5; i++)
         {
             ProtocolExtensionField item = ProtocolExtensionField.PerDecoder.Instance.Decode(input);
             capacity.iE_Extensions.Add(item);
         }
     }
     return capacity;
 }