Today the impl is just a quick naive: allocate native segment, then the array in Swift has to copy the bytes again.
Using [UInt8] at boundaries leads to un-necessary copying; prefer using Data or DataProtocol today.
It would be interesting to get this down to one single call, but we need to get the heap array from java written into native anyway.