???????????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