File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Samples/SwiftKitSampleApp/src/main/java/com/example/swift Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -88,14 +88,11 @@ static void examples() {
88
88
var origDat = Data .init (origBytes , origBytes .byteSize (), arena );
89
89
SwiftRuntime .trace ("origDat.count = " + origDat .getCount ());
90
90
91
- // var origBytes = arena.allocate(ValueLayout.JAVA_INT, arry.length);
92
- // origBytes.copyFrom(MemorySegment.ofArray(arry));
93
- // var dat = MySwiftLibrary.globalReceiveReturnData(origDat, arena);
94
- // dat.withUnsafeBytes((retBytes) -> {
95
- // SwiftKit.trace("retBytes=" + retBytes.toArray(ValueLayout.JAVA_INT)[1]);
96
- // SwiftKit.trace("foobar");
97
- // });
98
- //SwiftKit.trace(origDat);
91
+ var retDat = MySwiftLibrary .globalReceiveReturnData (origDat , arena );
92
+ retDat .withUnsafeBytes ((retBytes ) -> {
93
+ var str = retBytes .getString (0 );
94
+ SwiftRuntime .trace ("retStr=" + str );
95
+ });
99
96
}
100
97
101
98
You can’t perform that action at this time.
0 commit comments