二进制VS文本协议 [英] binary vs text protocols

查看:217
本文介绍了二进制VS文本协议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道的区别是二进制和基于文本的协议之间是什么。
我读了二进制协议更契约/更快的处理。
这是如何工作的呢?既然你要发送的数据的一样多吗?否?

I am wondering what the differences are between binary and text based protocols. I read that binary protocols are more compacts/faster to process. How does that work out? Since you have to send the same amount of data? No?

例如会怎么字符串hello的大小以二进制格式有什么不同?

E.g how would the string "hello" differ in size in binary format?

感谢

推荐答案

如果你正在做的是传递文本,那么,两者之间的差别并不十分显著。但考虑尝试传输这样的话:

If all you are doing is transmitting text, then yes, the difference between the two isn't very significant. But consider trying to transmit things like:


  • 数字 - 你用一个字符串再一个数字或二进制的presentation?特别是对于大的数字,二进制将更加紧凑。

  • 数据结构 - 你如何表示的开始和文本协议字段的结束?有时固定长度字段二进制协议更加紧凑。

这篇关于二进制VS文本协议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆