Skip to content

在存储类似String这些非基本数据类型时为什么需要额外存储一个 “数据占用的字节和数据占用的字节的字节" 这样一段数据 #683

Answered by lingol
mrdcn asked this question in Q&A
Discussion options

You must be logged in to vote

Yep. It's OK to ignore that size of a string when encoding only one value. However, when encoding a list of strings, that size is required for each string value inside. For the clarity of code, we make that logic the same.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mrdcn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants