We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aefa797 commit 1d59f73Copy full SHA for 1d59f73
example/Class1.cs renamed to example/TestClass.cs
@@ -2,16 +2,18 @@
2
using System.Runtime.InteropServices;
3
using System;
4
5
-namespace example
+namespace Example
6
{
7
- public class Class1
+ public class TestClass
8
9
public static int Test(IntPtr arg, int size) {
10
var buf = new byte[size];
11
- Marshal.Copy(arg, buf);
+ Marshal.Copy(arg, buf, 0, size);
12
var bufAsString = Encoding.UTF8.GetString(buf);
13
var result = bufAsString.Length;
14
- Console.WriteLine($"Called {nameof(Test)} in {nameof(Class1)} with {bufAsString}, returning {result}");
+ Console.WriteLine($"Called {nameof(Test)} in {nameof(TestClass)} with {bufAsString}, returning {result}");
15
+ Console.WriteLine($"Binary data: {Convert.ToBase64String(buf)}");
16
+
17
return result;
18
}
19
0 commit comments