3 messages in net.java.dev.jna.users[jna-users] Copy from one pointer to ...
FromSent OnAttachments
Duncan McGregorJun 19, 2008 1:31 am 
Duncan McGregorJun 19, 2008 3:19 pm 
Michael Brewer-DavisJun 20, 2008 11:04 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[jna-users] Copy from one pointer to anotherActions...
From:Duncan McGregor (dun@oneeyedmen.com)
Date:Jun 19, 2008 1:31:30 am
List:net.java.dev.jna.users

Hi

I need to load a Structure from an existing pointer. Is there any more straightforward way than my current

Pointer pointerToResult = buffer.getPointer(0); Structure result = javaParameterType.newInstance(); byte[] structBytes = new byte[result.size()]; pointerToResult.read(0, structBytes, 0, structBytes.length); Pointer structMemory = result.getPointer(); structMemory.write(0, structBytes, 0, structBytes.length); result.read();

Cheers

Duncan