💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
~~~ public static void main(String[] args) throws Exception{ DataInfo.Student student = DataInfo.Student.newBuilder() .setName("张三") .setAge(20) .setAddress("北京") .build(); byte[] student2ByteArray = student.toByteArray(); DataInfo.Student student1 = DataInfo.Student.parseFrom(student2ByteArray); System.out.printf(student1.getName()); System.out.printf(student1.getAge()+""); System.out.printf(student1.getAddress()); } ~~~