Describe the bug
rt, i can't use it in js and java.
Expected behavior
if fury support cross platform, the action will be success
To Reproduce
js code
import Fury, {InternalSerializerType, Type} from '@furyjs/fury';
import * as fs from "fs";
function main1() {
const description = Type.object("example.bar", {
c: Type.array(Type.object("example.foo", {
a: Type.string()
}))
});
const fury = new Fury();
const {serialize, deserialize} = fury.registerSerializer(description);
const o = {a: "123"};
const rawObject = {c: [o, o]}
console.log(`rawObject: ${JSON.stringify(rawObject)}`);
const data = serialize({c: [o, o]})
// create data directory
if (!fs.existsSync('data')) {
fs.mkdirSync('data');
}
// write data to file 'test.data'
fs.writeFileSync('data/test.data', data);
const deserialized = deserialize(data)
console.log(`deserialized: ${JSON.stringify(deserialized)}`)
}
java code
import cn.hutool.core.io.FileUtil;
import io.fury.Fury;
import io.fury.Language;
/**
* @author Harrison
* @since 11.0
* Created on 2023/7/19
*/
public class FuryTest {
public static class Test {
A[] c;
}
public static class A {
public String a;
}
public static void main(String[] args) {
Fury fury = Fury.builder().withLanguage(Language.XLANG)
.withRefTracking(true)
.withSecureMode(false)
.build();
fury.register(Test.class, "example.bar");
fury.register(A.class, "example.foo");
byte[] bytes = FileUtil.readBytes("/Users/3dot141/Work/w_source/MagicKit/data/test.data");
// bytes can be data serialized by other languages.
Test test = new Test();
A a1 = new A();
a1.a = "123";
A a2 = new A();
a2.a = "123";
test.c = new A[]{a1, a2};
byte[] serialize = fury.serialize(test);
Object deserialize = fury.deserialize(bytes);
;
System.out.println();
}
}
Screenshots

Environment (please complete the following information):
Describe the bug
rt, i can't use it in js and java.
Expected behavior
if fury support cross platform, the action will be success
To Reproduce
js code
java code
Screenshots

Environment (please complete the following information):