public unsafe void Write(Int24 i) { var ip = (byte *)&i; Write(new Union { Byte0 = ip[0], Byte1 = ip[1], Byte2 = ip[2] }, sizeof(byte) * 3); }
public unsafe Int24 ReadInt24() { var u = ReadUnion(sizeof(byte) * 3); var i = new Int24(); var ip = &i; ip[0] = u.Byte0; ip[1] = u.Byte1; ip[2] = u.Byte2; return(*ip); }