1

次のように宣言されたバイト配列のデータ型を使用しています。

byte[] sendbuf= new byte[64];

後で、私は電話します:

dev.write(sendbuf);  // see class code below for this

OSX 10.7.5 ではすべて正常に動作するのに、Windows XP では「パラメーターが正しくありません」という例外が発生する理由を誰か教えてもらえますか? 2 つのオペレーティング システム間でデータ型に違いはありますか?

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)
4

1 に答える 1