protobuf noteworthy

version: 2.6.1
1. missing input file
E:\software\protoc-2.6.1-win32>protoc.exe --proto_path=D:\derek\luna_space\ps2\src\main\java\com\Match.proto --java_out=./
Missing input file.

Analysis: don't use the Windows file path for protobuf compiler. the following command executes succesfully.
D:\derek\luna_space\ops2\src\main\java\com>E:\software\protoc-2.6.1-win32\protoc.exe Match.proto --java_out=./

2. Expected field name
Analysis: Although the protobuf version 2 documentation has the map section, but actually version 2 doesn't support map, the workaround:
http://stackoverflow.com/questions/29407123/have-to-create-java-pojo-for-the-existing-proto-includes-map

3. [packed = true] can only be specified for repeated primitive fields.

你可能感兴趣的:(protobuf noteworthy)