Comparison bewteen Google Protocol Buffer and Newtonsoft.Json.
Video may be found here:
Google Protocol Serializer documentation :
You will find the protoc.exe in this repository. However it my be outdated, so you can download from here. You may find it on the bottom of the list looking like protoc-version-operating_system.zip. For exemple: protoc-3.14.0-win32.zip
We will continue this article by showing you how to run the Protobuf command.
Go the the location where you have the protoc.exe downloaded. Open any command line utility. There is no need to run it as administrator.
The command has the following pattern:
protoc -I="your_class_path" --cdharp_out="your_path_where_you_want_your_otputed_proto_class" "your_proto_executable"
The command should look like:
protoc -I="C:\Users\Liviu\Career\Articles\Protocol-Buffer-Vs-Newtonsoft.Json\ConsoleApp1" --csharp_out="C:\Users\Liviu\Career\Articles\Protocol-Buffer-Vs-Newtonsoft.Json\ConsoleApp1" "C:\Users\Liviu\Career\Articles\Protocol-Buffer-Vs-Newtonsoft.Json\ConsoleApp1\demo-interface.proto"
Right now, all you have to do is to run the solution and two methods will be called:
SerializeProtoBuff(dataSize)
and
SerializeJson(dataSize)
We will skip showing how to utilize the NewtonSoft.Json library.
Contributions are wellcomed! :-)