I need to pass a raw back to Java via JRI, but it doesn't support raws, only various other vector types (such as integers). How do I convert a raw (vector of bytes) into a vector of integers?
I tried passing the data back as a vector of strings, but that breaks because JRI doesn't decode the string properly (eg '\x89' gets discarded as "").
Would also be nice if it were more efficient (unboxed). as.integer
does not work - it doesn't return the byte values of the characters in the array, not to mention the fact that rawToChar produces "" for nuls.