public RIMTransfer Decode(BitArrayInputStream input) { RIMTransfer transfer = new RIMTransfer(); transfer.InitDefaults(); BitMaskStream stream = (input.readBit() != 0) ? new BitMaskStream(input, 2) : new BitMaskStream(input, 2); input.skipUnreadedBits(); int nBits = 0; while (true) { switch (input.readBit()) { case 0: nBits += input.readBits(7); goto Label_00C9; case 1: switch (input.readBit()) { case 0: nBits += input.readBits(14); goto Label_00C9; case 1: input.readBits(2); nBits += input.readBits(4) * 0x400; break; } break; } } Label_00C9: transfer.rIMInformation = input.readOctetString(nBits); if (stream.Read()) { transfer.rIMRoutingAddress = RIMRoutingAddress.PerDecoder.Instance.Decode(input); } if (stream.Read()) { input.skipUnreadedBits(); transfer.iE_Extensions = new List <ProtocolExtensionField>(); const int num4 = 0x10; int num5 = input.readBits(num4) + 1; for (int i = 0; i < num5; i++) { ProtocolExtensionField item = ProtocolExtensionField.PerDecoder.Instance.Decode(input); transfer.iE_Extensions.Add(item); } } return(transfer); }
public RIMTransfer Decode(BitArrayInputStream input) { RIMTransfer transfer = new RIMTransfer(); transfer.InitDefaults(); BitMaskStream stream = (input.ReadBit() != 0) ? new BitMaskStream(input, 2) : new BitMaskStream(input, 2); input.skipUnreadedBits(); int nBits = 0; while (true) { switch (input.ReadBit()) { case 0: nBits += input.ReadBits(7); goto Label_00C9; case 1: switch (input.ReadBit()) { case 0: nBits += input.ReadBits(14); goto Label_00C9; case 1: input.ReadBits(2); nBits += input.ReadBits(4) * 0x400; break; } break; } } Label_00C9: transfer.rIMInformation = input.readOctetString(nBits); if (stream.Read()) { transfer.rIMRoutingAddress = RIMRoutingAddress.PerDecoder.Instance.Decode(input); } if (stream.Read()) { input.skipUnreadedBits(); transfer.iE_Extensions = new List<ProtocolExtensionField>(); const int num4 = 0x10; int num5 = input.ReadBits(num4) + 1; for (int i = 0; i < num5; i++) { ProtocolExtensionField item = ProtocolExtensionField.PerDecoder.Instance.Decode(input); transfer.iE_Extensions.Add(item); } } return transfer; }