怎么样蚕食等。
没有。即使你有布尔数组,我相信他们指定的占用每一个字节。
No. Even if you have an array of Booleans, I believe they're specified to take up one byte each.
当然,你可以定义哪些少于256有效值(如布尔
一样)自己的数据类型,但你不能让它占用不到一个字节在存储器中。
Of course you can define your own data types which have fewer than 256 valid values (like Boolean
does) but you can't make it take up less than a byte in memory.
由于LBushkin指出,有型,如 BitArray
和 BitVector32
,有效地高效地打包多个位 - 你可以编写自己的 NybbleArray
如果你想要的类型。
As LBushkin pointed out, there are types such as BitArray
and BitVector32
which effectively pack multiple bits efficiently - you could write your own NybbleArray
type if you wanted.
上一篇:错误分析数据org.json.JSONException:输入的字符0结束字符、错误、结束、数据
下一篇:ArrayAdapter和SimpleAdapter之间进行选择ArrayAdapter、SimpleAdapter