By simply copying the array reference instead of cloning it, both the message and the class that produces it hold a reference to the master copy of the previous bids array.
通过简单地复制而不是克隆数组引用,消息和产生消息的类都保存了前一投标数组的主副本的一个引用。
When you then update the array's contents with ReleaseLongArrayElements , another copy of 8,000 bytes might be required to update the array.
当您随后使用ReleaseLongArrayElements更新数组的内容时,需要另外复制8,000字节的数据来更新数组。
For the new CopyOnWriteArrayList and CopyOnWriteArraySet classes, all mutable operations make a copy of the backing array first, make the change to the copy, and then replace the copy.
对于新的CopyOnWriteArrayList和copyonwritearrayset类,所有可变的(mutable)操作都首先取得后台数组的副本,对副本进行更改,然后替换副本。
应用推荐