/// <summary>
                    /// Creates an initialized MLWebRTCDataChannelMessage object.
                    /// </summary>
                    /// <param name="message">The string message to send.</param>
                    /// <returns>An initialized MLWebRTCDataChannelMessage object.</returns>
                    public static MLWebRTCDataChannelMessage Create(string message)
                    {
                        MLWebRTCDataChannelMessage channelMessage = new MLWebRTCDataChannelMessage();

                        channelMessage.Version  = 1;
                        channelMessage.Data     = Marshal.StringToHGlobalAnsi(message);
                        channelMessage.DataSize = (ulong)message.Length;
                        channelMessage.IsBinary = false;
                        return(channelMessage);
                    }
                    /// <summary>
                    /// Creates an initialized MLWebRTCDataChannelMessage object.
                    /// </summary>
                    /// <param name="message">The byte array message to send.</param>
                    /// <returns>An initialized MLWebRTCDataChannelMessage object.</returns>
                    public static MLWebRTCDataChannelMessage Create <T>(T[] message)
                    {
                        MLWebRTCDataChannelMessage channelMessage = new MLWebRTCDataChannelMessage();

                        channelMessage.Version = 1;
                        int typeSize = Marshal.SizeOf(typeof(T));
                        int unmanagedByteArrayLength = (typeSize * message.Length);

                        channelMessage.Data = Marshal.AllocHGlobal(unmanagedByteArrayLength);
                        IntPtr next = channelMessage.Data;

                        for (int i = 0; i < message.Length; ++i)
                        {
                            Marshal.StructureToPtr(message[i], next, false);
                            next = IntPtr.Add(next, typeSize);
                        }

                        channelMessage.DataSize = (ulong)unmanagedByteArrayLength;
                        channelMessage.IsBinary = true;
                        return(channelMessage);
                    }