On 02/10/2016 02:16 PM, Chris Vest wrote:
I’m slightly more worried about their array and what it implies, though. This API requires of me that I’m able to present all of the relevant buffers up front. In my case, these buffers are shared between multiple threads, so they are guarded by locks. I must take all the locks for all the buffers and hold them for the duration of the copy._Maybe_ I have to do that anyway, but if there’s a way for me to only lock one buffer at a time, I’d like to be able to exploit this. The builder approach holds this door open for me.
In that case, you can't estimate the String array length upfront and you are forced to do copying afterwards. So you have to choose what is more important for you. Or do you have a case where the lengths of buffer sub-ranges are known in advance and you only want to gather their content one-by-one?
Regards, Peter
Cheers, Chris