6 messages in net.java.dev.jna.users[jna-users] UnsupportedOperationExcep...
FromSent OnAttachments
Stas OskinMay 26, 2009 4:28 am 
Timothy WallMay 26, 2009 4:42 am 
Stas OskinMay 26, 2009 5:02 am 
Timothy WallMay 26, 2009 5:17 am 
Stas OskinMay 26, 2009 5:28 am 
Stas OskinMay 27, 2009 4:18 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] UnsupportedOperationException when trying to get byte array fom ByteBufferActions...
From:Stas Oskin (stas@gmail.com)
Date:May 26, 2009 4:28:29 am
List:net.java.dev.jna.users

Hi.

I'm trying to directly access memory located in pointer, but for some reason I can only do it if I copy the memory via getByteArray().

Running the code below:

buf -> Pointer; final byte[] ba = buf.getByteBuffer(0, size).array();

Produces: Caused by: java.lang.UnsupportedOperationException

at java.nio.ByteBuffer.array(ByteBuffer.java:940)

Can someone advice how this can be solved?

Thanks in advance.