public int CalcSize() { YkdFrames[] frames = Frames ?? new YkdFrames[0]; YkdOffsets offsets = new YkdOffsets { Offsets = new int[frames.Length] }; return(NameSize + offsets.CalcSize() + frames.Sum(t => t.CalcSize())); }
public int CalcSize() { YkdBlockEntry[] entries = Entries ?? new YkdBlockEntry[0]; YkdOffsets offsets = new YkdOffsets { Offsets = new int[entries.Length] }; int result = 4 * 4 + TransformationMatrixSize + offsets.CalcSize() + entries.Sum(t => t.CalcSize()); if (ZeroTail != null) { result += YkdBlockOptionalTail.Size; } else if (Tails4 != null) { result += Tails4.CalcSize(); } else if (Tail56 != null) { result += Tail56.Length * 4; } return(result); }