我在Android项目中使用JNI代码,其中JNI本机函数需要short []参数.但是,原始数据存储为ByteBuffer.我正在尝试转换数据格式如下.
ByteBuffer rgbBuf = ByteBuffer.allocate(size);
...
short[] shortArray = (short[]) rgbBuf.asShortBuffer().array().clone();
Run Code Online (Sandbox Code Playgroud)
但是在运行上面显示的第二行代码时遇到以下问题:
E/AndroidRuntime(23923): Caused by: java.lang.UnsupportedOperationException
E/AndroidRuntime(23923): at Java.nio.ShortToByteBufferAdapter.protectedArray(ShortToByteBufferAdapter.java:169)
Run Code Online (Sandbox Code Playgroud)
任何人都可以提出实施转换的方法吗?
我为Windows中的tortoisehg设置了代理服务器的"全局设置".当我尝试连接到bitbucket存储库时,由tortoisehg生成的命令行是hg clone --debug-- http://bitbucket.org/<path to repo>
.
控制台显示如下:
using http://bitbucket.org/<path to repo>
proxying through http://172.19.6.47:8080
http auth: user <username>, password not set
sending capabilities command
Run Code Online (Sandbox Code Playgroud)
我还运行wireshark来监控流量.令我惊讶的是,流量直接转移到bitbucket.我认为它应该首先将数据包发送到代理服务器.这是否意味着我的代理服务器没有生效?我该怎么做才能使它生效?