开发者

Resize a byte array

In a nat开发者_StackOverflow社区ive function with a jbyteArray argument, I want to pass data back into the calling app using SetByteArrayRegion.

I would like to resize the array to exactly fit the data, is that possible?


You can't. Arrays are fixed size in java.

Possible solution would be to use a different data structure (e.g. ArrayList) or you could create a jbyteArray of the correct size and let the native function return this.


No, that is not possible, just as you can't resize arrays in java.

You need to create and return new array.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜