JNA wrapper for <sys/xattr.h>#338
JNA wrapper for <sys/xattr.h>#338twall merged 9 commits intojava-native-access:masterfrom rednoah:master
Conversation
|
Please add a line to CHANGES.md. Otherwise, LGTM. Kudos for including tests. |
There was a problem hiding this comment.
There seems to be some overlap here with Native.toString(byte[]) and Pointer.setString()/setWideString().
There was a problem hiding this comment.
So if I wanted a Pointer to a NULL-terminated UTF-8 String I'd use Pointer.setString("XYZ", "UTF-8")? In the docs it doesn't explicitly state it will be NULL-terminated. Also String.length() isn't necessarily the byte size once encoded, so will this automatically allocate the necessary memory as well?
There was a problem hiding this comment.
Pointer.setString() does NUL-terminate, but since you need to allocate space here as well, that function doesn't help much. The class NativeString actually does what you want, but it's package-protected.
I think your code is fine as is.
change notes for the xattr wrapper
reference pull request
fix reference
fix <>
|
ok, fixed changes and null |
Here is my wrapper for <sys/xattr.h> with support for xattr list/get/set/remove.
Tested on OS X 10.9.2