static byte[] StructToByte(object obj) { //구조체 사이즈 int size = Marshal.SizeOf(obj); //사이즈 만큼 메모리 할당 받기 byte[] buffer = new byte[size]; IntPtr ptr = Marshal.AllocHGlobal(size); //구조체 주소값 가져오기 Marshal.StructureToPtr(obj, ptr, false); //메모리 복사 Marshal.Copy(ptr, buffer, 0, size); Marshal.FreeHGlobal(ptr); return buffer; } public static byte[] StructToByte(T structure) where T : struct { byte[] buffer..