private UInt16 CalculateFpUpdatePduLength(byte length1, byte length2)
{
if ((ConstValue.MOST_SIGNIFICANT_BIT_FILTER & length1) == length1)
{
// when length1's most significant bit is not set
// only length1 is considered
return (UInt16)length1;
}
else
{
// when length1's most significant bit is set
// length1 and length2 are concatenated
byte[] buffer = new byte[2];
buffer[0] = length2;
buffer[1] = (byte)(ConstValue.MOST_SIGNIFICANT_BIT_FILTER & length1);
UInt16 length = BitConverter.ToUInt16(buffer, 0);
return length;
}
}