ProtoBuf??java???
???????????? ???????[ 2014/9/26 11:16:05 ] ??????????????? Java
???????????Proto?????????????????
????windows :
????1???????????proto.exe?? protobuf-java-2.4.1.jar
????2?????????????TestPb???????潨?????proto?????????????????proto?????
????3????proto??exe????????£?
????4?????????msg.proto?????
option java_package = "com.protobuftest.protobuf";
option java_outer_classname = "PersonProbuf";
message Person {
required string name = 1;
required int32 id = 2;
optional string email = 3;
enum PhoneType {
MOBILE = 0;
HOME = 1;
WORK = 2;
}
message PhoneNumber {
required string number = 1;
optional PhoneType type = 2 [default = HOME];
}
repeated PhoneNumber phone = 4;
message CountryInfo {
required string name = 1;
required string code = 2;
optional int32 number = 3;
}
}
message AddressBook {
repeated Person person = 1;
}
????5?????? java???????proto.exe???£?protoc --java_out=./src ./proto/msg.proto
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11