public byte [] readControl (byte type, byte request,
	    short value, short index, short length)
    throws IOException
    {
	byte	data [] = new byte [length & 0xffff];
	int	status;

	if (length >= MAX_CONTROL_LENGTH
		|| (type & ControlMessage.DIR_TO_HOST) == 0)
	    throw new IllegalArgumentException ();

	if (Windows.trace)
	    System.out.println (
		  "Dev.readControl, rqt 0x" + Integer.toHexString (0xff & type)
		+ ", req 0x" + Integer.toHexString (0xff & request)
		+ ", value 0x" + Integer.toHexString (0xffff & value)
		+ ", index 0x" + Integer.toHexString (0xffff & index)
		+ ", len " + Integer.toString (0xffff & length)
		);

	status = controlMsg (fd, type, request, value, index,
		data, 0, (short) data.length);
	if (status >= 0) {
	    if (status != data.length) {
		byte temp [] = new byte [status];
		System.arraycopy (data, 0, temp, 0, status);
		data = temp;
	    }
	    return data;
	}
	throw new USBException ("control read error", -status);
    }