public void Test_00__native <T>(T data) where T : unmanaged { DataStream from = DataStream.FromUnmanaged(data); string b64 = from.ToBase64(); string hex = from.ToHexString(); byte[] arr = from.ToBytes(); T t1 = DataStream.FromBytes(arr).ToUnmanaged <T>(); T t2 = DataStream.FromBase64(b64).ToUnmanaged <T>(); T t3 = DataStream.FromHex(hex).ToUnmanaged <T>(); Assert.AreEqual(data, t1); Assert.AreEqual(data, t2); Assert.AreEqual(data, t3); }