7 messages in net.java.dev.jna.usersRe: [jna-users] Mapping posix message...
FromSent OnAttachments
Patrick SchäferMay 8, 2009 3:53 am 
Timothy WallMay 8, 2009 4:02 am 
Patrick SchäferMay 8, 2009 4:50 am 
Daniel KaufmannMay 8, 2009 5:35 am 
Timothy WallMay 8, 2009 5:37 am 
Patrick SchäferMay 8, 2009 6:35 am 
Timothy WallMay 8, 2009 6:55 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:Re: [jna-users] Mapping posix message queue in C to JavaActions...
From:Timothy Wall (twal@dev.java.net)
Date:May 8, 2009 6:55:37 am
List:net.java.dev.jna.users

If you need the null terminator on a string, you should use Native.toByteArray(String) rather than String.getBytes(). The former will give you 5 bytes in the following code, while the latter will give you only 4, omitting the null terminator.

On May 8, 2009, at 9:35 AM, Patrick Schäfer wrote:

// Send Message MsgBuf sndBuf = (MsgBuf) Structure.newInstance(MsgBuf.class); sndBuf.mtype = new NativeLong(5); sndBuf.data = "test".getBytes("UTF-8");