yuluo-yx opened a new issue, #2165:
URL: https://github.com/apache/fury/issues/2165
### Question
```java
package indi.yuluo.fury;
import org.apache.fury.Fury;
import org.apache.fury.config.Language;
public class FuryExample {
public static void main(String[] args) {
User user = new User();
user.setName("test");
user.setAge(20);
// 重复使用 Fury 对象
Fury fury = Fury.builder().withLanguage(Language.JAVA)
.requireClassRegistration(true)
.build();
// 注册类
// fury.register(User.class);
// 序列化
byte[] bytes = fury.serialize(user);
// System.out.println("序列化结果: " + Arrays.toString(bytes));
// 输出反序列化结果
User user1 = (User) fury.deserialize(bytes);
System.out.println(user1);
}
}
```
User.java
```java
public class User {
private String name;
private Integer age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]