private static Interface getHID (Device dev)
    throws IOException
    {
	Configuration		config;
	Interface		retval = null;
	DeviceDescriptor	info = dev.getDeviceDescriptor ();


	if (info.getDeviceClass () != 0)
	    throw new IllegalArgumentException ("dev class");

	config = dev.getConfiguration ();
	for (int i = config.getNumInterfaces (); i-- != 0; ) {
	    Interface intf = config.getInterface (i, 0);
	    if (intf.getInterfaceClass () == intf.CLASS_HID) {
		if (retval != null)
		    throw new IllegalArgumentException ("multi-hid");
		retval = intf;
	    }
	}
	if (retval == null)
	    throw new IllegalArgumentException ("not hid");
	return retval;
    }