예제 #1
0
        internal void SetData(byte[] data, ToxSaveDataType type)
        {
            if (type == ToxSaveDataType.SecretKey && data.Length != ToxConstants.SecretKeySize)
                throw new ArgumentException("Data must have a length of ToxConstants.SecretKeySize bytes", "data");

            SaveDataType = type;
            SaveDataLength = (uint)data.Length;
            SaveData = Marshal.AllocHGlobal(data.Length);

            Marshal.Copy(data, 0, SaveData, data.Length);
        }
예제 #2
0
        internal void SetData(byte[] data, ToxSaveDataType type)
        {
            if (type == ToxSaveDataType.SecretKey && data.Length != ToxConstants.SecretKeySize)
            {
                throw new ArgumentException("Data must have a length of ToxConstants.SecretKeySize bytes", "data");
            }

            SaveDataType   = type;
            SaveDataLength = (uint)data.Length;
            SaveData       = Marshal.AllocHGlobal(data.Length);

            Marshal.Copy(data, 0, SaveData, data.Length);
        }