public void UpdateSize()
{
attributeSize = 0;
if (attributes != null)
{
foreach (KeyValuePair<string, PssgAttribute> attr in attributes)
{
attr.Value.UpdateSize();
attributeSize += 8 + attr.Value.Size;
}
}
size = 4 + attributeSize;
if (subNodes != null)
{
foreach (PssgNode node in subNodes)
{
node.UpdateSize();
size += 8 + node.Size;
}
}
if (isDataNode)
{
size += data.Length;
}
}