I\'m in the process of creating a buffer that will read/write in a banner in which I can completely eradicate the problems that comes with TCP-Segmentation. The only problem
BitConverter creates some overhead and unnecessary buffer. This solution is almost as fast as unsafe conversion:
[StructLayout(LayoutKind.Explicit)]
struct FloatToInt
{
[FieldOffset(0)]private float f;
[FieldOffset(0)]private int i;
private static FloatToInt inst = new FloatToInt();
public static int Convert(float value)
{
inst.f = value;
return t.i;
}
}