In example:
struct Bridge { public float float1; public bool bool1; public bool bool2; public bool bool3; public bool bool4; }
size of above structure must be 5, but when reading by ReadStruct, it spawns exeption.
Inside this function, call to Struct.GetStructSize returns 4.
I believe there must be something like return (int)Math.Ceiling(numBytes); instead of return (int)numBytes;
This happens when struct ends by from 1 to 7 bool-s.
//sorry for my English
In example:
struct Bridge { public float float1; public bool bool1; public bool bool2; public bool bool3; public bool bool4; }size of above structure must be 5, but when reading by ReadStruct, it spawns exeption.
Inside this function, call to Struct.GetStructSize returns 4.
I believe there must be something like
return (int)Math.Ceiling(numBytes);instead ofreturn (int)numBytes;This happens when struct ends by from 1 to 7 bool-s.
//sorry for my English