public BacNetTag(byte[] tagBytes, int startIndex, ref int len)
{
Number = (byte)(tagBytes[startIndex] >> 4);
Class = ((tagBytes[startIndex] >> 3) & 1) == 1;
byte tmpLength = (byte)(tagBytes[startIndex] & 7);
if (tmpLength == 5)
{
Length = tagBytes[startIndex + 1];
_longTag = true;
len += 2;
}
else
{
Length = tmpLength;
_longTag = false;
len += 1;
}
}