ProtoBuff.Net 不支持空值。为什么?

ProtoBuff.Net do not support null. Why?

为什么ProtoBuff.Net不支持null

我正在浏览 ProtoBuf,想知道为什么不支持 null 值。当我们尝试分配 null 值时,它给出了异常。即使像字符串这样的引用也不支持这个。

pb::ThrowHelper.ThrowIfNull(value, "value"); 

我知道 PROTO 想要保持最基本的东西,以便它支持大量语言(这就是为什么没有 DateTime),但是 null 是跨语言的概念吗?

或者我可能忽略了什么。

很简单,因为底层协议规范("protobuf")没有null的概念,也没有办法表达。如果我不能在协议中表达,能支持的最好是某种隐含的"the absence of something means leave it alone which means it will probably be null".