我正在使用声明为的字节数组数据类型:
byte[] sendbuf= new byte[64];
后来,我打电话:
dev.write(sendbuf); // see class code below for this
谁能告诉我为什么在 OSX 10.7.5 下一切正常,但在 Windows XP 下我得到一个异常“参数不正确”?两个操作系统之间的数据类型有区别吗?
HIDDevice.class 是:
public native int write(byte[] data) throws IOException;
/**
* Read an Input Report to a HID device.
*
* @param buf a buffer to put the read data into
* @return the actual number of bytes read
* @throws IOException if read error occured
*/
这是错误:
java.io.IOException: The parameter is incorrect.
at com.codeminders.hidapi.HIDDevice.write(Native Method)
at HIDTesting2.hidData.run(hidData.java:96)