protected void UpdateLengthOfLength(uint length)
{
// TODO: check this logic
if (length <= Byte.MaxValue)
{
HeaderBits.Sp = (int)Len_Values.OneByte;
}
else if (length <= UInt16.MaxValue)
{
HeaderBits.Sp = (int)Len_Values.TwoBytes;
}
else if (length <= UInt32.MaxValue)
{
HeaderBits.Sp = (int)Len_Values.FourBytes;
}
else
{
DynamicVCException.Throw("The field Length is too long.");
}
}