Android RenderScript Allocation copy from NIO Direct ByteBuffer -


on android platform (api-19) copy direct byte buffer render script allocation. possible improve following code, example using ndk?

final bytebuffer buffer = ...src;  final byte[] bytes; if (buffer.hasarray()) {     bytes = buffer.array(); } else {     bytes = new byte[buffer.capacity()];     buffer.get(bytes);     buffer.rewind(); } allocation.copyfromunchecked(bytes); 

unfortunately, no. apis not constructed can provide backing data store allocation or retrieve nio based buffer allocation created. closest thing use have bitmap based allocation created usage_shared sync'd differences rather full copy.


Comments

Popular posts from this blog

javascript - IndexedDB error: Uncaught DataCloneError: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned -

amazon web services - When using Cognito credentials with AWS in a browser (javascript), keep getting "missing credentials" error -

c# - How to set the datatextfield value instead of the value on a drop down list? -