Go to file
YuCheng Hu a39a883cfc 修改项目用途为测试序列化和反序列化的相关工具和 Demo 2019-08-05 10:48:59 -04:00
src/main/proto 提交 simple proto 配置文件 2019-07-23 14:28:19 -04:00
.gitignore Add ignore file for Intellij 2019-07-23 13:50:35 -04:00
README.adoc 修改项目用途为测试序列化和反序列化的相关工具和 Demo 2019-08-05 10:48:59 -04:00
build.gradle 提交编译配置文件 2019-07-23 13:57:40 -04:00
gradlew 提交编译文件 2019-07-22 13:15:59 -04:00
gradlew.bat 提交编译文件 2019-07-22 13:15:59 -04:00
settings.gradle 提交编译文件 2019-07-22 13:15:59 -04:00

README.adoc

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

= Serialize and Deserialize Java 示例程序

我们是在实际的数据处理的时候,需要使用 JSON 来序列化数据,但是又考虑到 JSON 在传输的时候数据过大,同时还有很多并不需要的垃圾文件。

== Protocol Buffer
我们才考虑到了 Protocol Buffer 提供的功能。

image::https://docs.ossez.com/protocol-buffers-docs/images/protocol-buffers-logo.jpg[]

== MessagePack
Its like JSON. but fast and small.

简单来讲它的数据格式与json类似但是在存储时对数字、多字节字符、数组等都做了很多优化减少了无用的字符二进制格式也保证不用字符化带来额外的存储空间的增加。

== 相关文档和资料
 * https://www.cwiki.us/display/ProtocolBuffers/Protocol+Buffers - cwiki.us 的 Protocol Buffer WIKI
 * http://docs.ossez.com/protocol-buffers-docs/index.html - Protocol Buffer 技术资料

== 数据序列化和反序列化
* 序列化: 将数据结构或对象转换成二进制串的过程。
* 反序列化:将在序列化过程中所生成的二进制串转换成数据结构或者对象的过程。

image::https://docs.ossez.com/protocol-buffers-docs/images/protocol-buffers-serialization.png[]