Convert the value according the type of DeviceData.

@param deviceDataArgout
the DeviceData attribute to read
@return String, the result in String format
@throws DevFailed
975113
public static String extractToString(final DeviceData deviceDataArgout) throws DevFailed {
	final Object[] values = CommandHelper.extractArray(deviceDataArgout);
	Object value = null;
	String argout = "";
	if (values.length == 1) {
	    value = values[0];
	    if (value instanceof DevState) {
		argout = StateUtilities.getNameForState((DevState) value);
	    } else if (value instanceof DevVarLongStringArray) {
		final int[] intValues = ((DevVarLongStringArray) value).lvalue;
		final String[] stringValues = ((DevVarLongStringArray) value).svalue;
		for (int i = 0; i < stringValues.length; i++) {
		    argout = argout + "DevVarLongStringArray[" + i + "]=(" + intValues[i] + ","
			    + stringValues[i] + ")\n";
		}
	    } else if (value instanceof DevVarDoubleStringArray) {
		final double[] doubleValues = ((DevVarDoubleStringArray) value).dvalue;
		final String[] stringValues = ((DevVarDoubleStringArray) value).svalue;
		for (int i = 0; i < stringValues.length; i++) {
		    argout = argout + "DevVarDoubleStringArray[" + i + "]=(" + doubleValues[i]
			    + "," + stringValues[i] + ")\n";
		}
	    } else {
		argout = value.toString();
	    }
	} else if (values.length > 1) {
	    for (int i = 0; i < values.length; i++) {
		if (values[i] instanceof DevState) {
		    argout = argout + values[i].getClass().getSimpleName() + "[" + i + "]="
			    + StateUtilities.getNameForState((DevState) values[i]) + "\n";
		} else {
		    argout = argout + values[i].getClass().getSimpleName() + "[" + i + "]="
			    + values[i].toString() + "\n";
		}
	    }
	} else {
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "output type " + value.getClass()
		    + " not supported",
		    "CommandHelper.extractToString(Object value,deviceDataArgin)");
	}

	return argout;
    }
39854
public static Object extract(final DeviceData deviceDataArgout) throws DevFailed {
	Object argout = null;
	switch (deviceDataArgout.getType()) {
	case TangoConst.Tango_DEV_SHORT:
	    argout = Short.valueOf(deviceDataArgout.extractShort());
	    break;
	case TangoConst.Tango_DEV_USHORT:
	    argout = Integer.valueOf(deviceDataArgout.extractUShort()).shortValue();
	    break;
	case TangoConst.Tango_DEV_CHAR:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "out type Tango_DEV_CHAR not supported",
		    "CommandHelper.extract(deviceDataArgout)");
	    break;
	case TangoConst.Tango_DEV_UCHAR:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "out type Tango_DEV_UCHAR not supported",
		    "CommandHelper.extract(deviceDataArgout)");
	    break;
	case TangoConst.Tango_DEV_LONG:
	    argout = Integer.valueOf(deviceDataArgout.extractLong());
	    break;
	case TangoConst.Tango_DEV_ULONG:
	    argout = Long.valueOf(deviceDataArgout.extractULong());
	    break;
	case TangoConst.Tango_DEV_LONG64:
	    argout = Long.valueOf(deviceDataArgout.extractLong64());
	    break;
	case TangoConst.Tango_DEV_ULONG64:
	    argout = Long.valueOf(deviceDataArgout.extractULong64());
	    break;
	case TangoConst.Tango_DEV_INT:
	    argout = Integer.valueOf(deviceDataArgout.extractLong());
	    break;
	case TangoConst.Tango_DEV_FLOAT:
	    argout = Float.valueOf(deviceDataArgout.extractFloat());
	    break;
	case TangoConst.Tango_DEV_DOUBLE:
	    argout = Double.valueOf(deviceDataArgout.extractDouble());
	    break;
	case TangoConst.Tango_DEV_STRING:
	    argout = deviceDataArgout.extractString();
	    break;
	case TangoConst.Tango_DEV_BOOLEAN:
	    argout = Boolean.valueOf(deviceDataArgout.extractBoolean());
	    break;
	case TangoConst.Tango_DEV_STATE:
	    argout = deviceDataArgout.extractDevState();
	    break;
	case TangoConst.Tango_DEVVAR_DOUBLESTRINGARRAY:
	    argout = deviceDataArgout.extractDoubleStringArray();
	    break;
	case TangoConst.Tango_DEVVAR_LONGSTRINGARRAY:
	    argout = deviceDataArgout.extractLongStringArray();
	    break;
	default:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "output type "
		    + deviceDataArgout.getType() + " not supported",
		    "CommandHelper.extract(Short value,deviceDataArgout)");
	    break;
	}

	return argout;
    }
673617
public DeviceAttribute[] write_read_attribute(
                final DeviceProxy deviceProxy,
			    final DeviceAttribute[] deviceAttributes) throws DevFailed {
        return write_read_attribute(deviceProxy, deviceAttributes, new String[0]);
    }
21902
public int (final String c, final boolean fgt, final boolean fwd) throws DevFailed {
	final int rid = _i(c, fgt, fwd, next_req_id());
	if (fgt == false) {
	    arp.put(new Integer(rid), new Boolean(fwd));
	}
	return rid;
    }
881980
public void poll_attribute(final DeviceProxy deviceProxy, final String attname, final int period)
	    throws DevFailed {
    	poll_object(deviceProxy, attname, "attribute", period);
    }
1043877
public DeviceData command_inout(String command, DeviceData argin) throws DevFailed {
		return iConnection.command_inout(this, command, argin);
	}
1212104
public List<ForwardedAttributeDatum> getForwardedAttributeInfoForDevice(String deviceName) throws DevFailed {
		List<String[]> data = databaseDAO.getForwardedAttributeDataForDevice(this, deviceName);
		List<ForwardedAttributeDatum> info = new ArrayList<ForwardedAttributeDatum>();
		for (String[] datum : data) {
			info.add(new ForwardedAttributeDatum(datum[0],datum[1],datum[2]));
		}
		return info;
	}
760706
public DeviceAttribute[] read_attribute_reply(final DeviceProxy deviceProxy,
                                                  final int id, final int timeout) throws DevFailed {
        DeviceAttribute[] argout = null;
        final int ms_to_sleep = 10;
        AsynReplyNotArrived except = null;
        final long t0 = System.currentTimeMillis();
        long t1 = t0;

        while ((t1 - t0 < timeout || timeout == 0) && argout == null) {
            try {
                argout = read_attribute_reply(deviceProxy, id);
            }
            catch (final AsynReplyNotArrived na) {
                except = na;
                // Wait a bit before retry
                try { Thread.sleep(ms_to_sleep); } catch (final InterruptedException e) { /* */ }
                t1 = System.currentTimeMillis();
            }
        }
        // If reply not arrived throw last exception
        if (argout == null) {
            ApiUtil.remove_async_request(id);
            throw except;
        }

        return argout;
    }
1243905
public static Object extract(final DeviceAttribute deviceAttributeRead) throws DevFailed {
	Object argout = null;
	if (deviceAttributeRead.getDimX() != 1 || deviceAttributeRead.getDimY() != 0) {
	    argout = extractArray(deviceAttributeRead);
	} else {

	    switch (deviceAttributeRead.getType()) {
	    case TangoConst.Tango_DEV_SHORT:
		argout = Short.valueOf(deviceAttributeRead.extractShort());
		break;
	    case TangoConst.Tango_DEV_USHORT:
		argout = Integer.valueOf(deviceAttributeRead.extractUShort()).shortValue();
		break;
	    case TangoConst.Tango_DEV_CHAR:
		// VH : a char correspond to a Byte in java
		// but deviceAttribute doesn't have a extractchar method !!!
		Except.throw_exception("TANGO_WRONG_DATA_ERROR",
			"out type Tango_DEV_CHAR not supported",
			"AttributeHelper.extract(deviceAttributeWritten)");
		break;
	    case TangoConst.Tango_DEV_UCHAR:
		argout = Short.valueOf(deviceAttributeRead.extractUChar()).shortValue();
		break;
	    case TangoConst.Tango_DEV_LONG:
		argout = Integer.valueOf(deviceAttributeRead.extractLong());
		break;
	    case TangoConst.Tango_DEV_ULONG:
		argout = Long.valueOf(deviceAttributeRead.extractULong());
		break;
	    case TangoConst.Tango_DEV_LONG64:
		argout = Long.valueOf(deviceAttributeRead.extractLong64());
		break;
	    case TangoConst.Tango_DEV_ULONG64:
		argout = Long.valueOf(deviceAttributeRead.extractULong64());
		break;
	    case TangoConst.Tango_DEV_INT:
		argout = Integer.valueOf(deviceAttributeRead.extractLong());
		break;
	    case TangoConst.Tango_DEV_FLOAT:
		argout = Float.valueOf(deviceAttributeRead.extractFloat());
		break;
	    case TangoConst.Tango_DEV_DOUBLE:
		argout = Double.valueOf(deviceAttributeRead.extractDouble());
		break;
	    case TangoConst.Tango_DEV_STRING:
		argout = deviceAttributeRead.extractString();
		break;
	    case TangoConst.Tango_DEV_BOOLEAN:
		argout = Boolean.valueOf(deviceAttributeRead.extractBoolean());
		break;
	    case TangoConst.Tango_DEV_STATE:
		argout = deviceAttributeRead.extractDevState();
		break;
	    default:
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", "output type "
			+ deviceAttributeRead.getType() + " not supported",
			"AttributeHelper.extract(Short value,deviceAttributeWritten)");
		break;
	    }
	}
	return argout;
    }
1226004
public short[] extractUCharArray() throws DevFailed {
		manageExceptions("extractUCharArray()");

		if (use_union) {
	    	final byte[] argOut = attributeValue_5.value.uchar_att_value();
	    	final short[] val = new short[argOut.length];
	    	final short mask = 0xFF;
	    	for (int i = 0; i < argOut.length; i++) {
			val[i] = (short) (mask & argOut[i]);
	    	}
	    	return val;
		} else {
	    	return deviceAttribute_3.extractUCharArray();
		}
    }
889963
public DevState[] extractDevStateArray() throws DevFailed {
	manageExceptions("extractDevStateArray()");
	try {
	    if (isArray()) {
		return DevVarStateArrayHelper.extract(attrval.value);
	    } else {
		// It is used for state attribute
		return new DevState[] { DevStateHelper.extract(attrval.value) };
	    }
	} catch (final org.omg.CORBA.BAD_PARAM e) {
	    Except
		    .throw_wrong_data_exception(
			    e.toString(),
			    "Exception catched : "
				    + e.toString()
				    + "\n"
				    + "Maybe the attribute value has not been initialized",
			    "DeviceAttribute.extractDevStateArray()");
	}
	return new DevState[0];// never used
    }
142269
public static Object[] extractArray(final DeviceData deviceDataArgout) throws DevFailed {
	Object[] argout = null;
	switch (deviceDataArgout.getType()) {
	case TangoConst.Tango_DEV_SHORT:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	case TangoConst.Tango_DEV_USHORT:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	case TangoConst.Tango_DEV_CHAR:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	case TangoConst.Tango_DEV_UCHAR:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	case TangoConst.Tango_DEV_LONG:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	case TangoConst.Tango_DEV_ULONG:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	case TangoConst.Tango_DEV_LONG64:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	case TangoConst.Tango_DEV_ULONG64:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	case TangoConst.Tango_DEV_INT:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	case TangoConst.Tango_DEV_FLOAT:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	case TangoConst.Tango_DEV_DOUBLE:
	    argout = new Object[] { Double.valueOf(deviceDataArgout.extractDouble()) };
	    break;
	case TangoConst.Tango_DEV_STRING:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	case TangoConst.Tango_DEV_BOOLEAN:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	case TangoConst.Tango_DEV_STATE:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;

	// Array input type
	case TangoConst.Tango_DEVVAR_SHORTARRAY:
	    final short[] shortValues = deviceDataArgout.extractShortArray();
	    argout = new Object[shortValues.length];
	    for (int i = 0; i < shortValues.length; i++) {
		argout[i] = Short.valueOf(shortValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_USHORTARRAY:
	    final int[] ushortValues = deviceDataArgout.extractUShortArray();
	    argout = new Object[ushortValues.length];
	    for (int i = 0; i < ushortValues.length; i++) {
		argout[i] = Integer.valueOf(ushortValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_CHARARRAY:
	    final byte[] charValues = deviceDataArgout.extractByteArray();
	    argout = new Object[charValues.length];
	    for (int i = 0; i < charValues.length; i++) {
		argout[i] = Byte.valueOf(charValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_LONGARRAY:
	    final int[] longValues = deviceDataArgout.extractLongArray();
	    argout = new Object[longValues.length];
	    for (int i = 0; i < longValues.length; i++) {
		argout[i] = Integer.valueOf(longValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_ULONGARRAY:
	    final long[] ulongValues = deviceDataArgout.extractULongArray();
	    argout = new Object[ulongValues.length];
	    for (int i = 0; i < ulongValues.length; i++) {
		argout[i] = Long.valueOf(ulongValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_LONG64ARRAY:
	    final long[] long64Values = deviceDataArgout.extractLong64Array();
	    argout = new Object[long64Values.length];
	    for (int i = 0; i < long64Values.length; i++) {
		argout[i] = Long.valueOf(long64Values[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_ULONG64ARRAY:
	    final long[] ulong64Values = deviceDataArgout.extractULong64Array();
	    argout = new Object[ulong64Values.length];
	    for (int i = 0; i < ulong64Values.length; i++) {
		argout[i] = Long.valueOf(ulong64Values[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_FLOATARRAY:
	    final float[] floatValues = deviceDataArgout.extractFloatArray();
	    argout = new Object[floatValues.length];
	    for (int i = 0; i < floatValues.length; i++) {
		argout[i] = Float.valueOf(floatValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_DOUBLEARRAY:
	    final double[] doubleValues = deviceDataArgout.extractDoubleArray();
	    argout = new Object[doubleValues.length];
	    for (int i = 0; i < doubleValues.length; i++) {
		argout[i] = Double.valueOf(doubleValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_STRINGARRAY:
	    final String[] stringValues = deviceDataArgout.extractStringArray();
	    argout = new Object[stringValues.length];
	    for (int i = 0; i < stringValues.length; i++) {
		argout[i] = stringValues[i];
	    }
	    break;

	case TangoConst.Tango_DEVVAR_LONGSTRINGARRAY:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	case TangoConst.Tango_DEVVAR_DOUBLESTRINGARRAY:
	    argout = new Object[] { CommandHelper.extract(deviceDataArgout) };
	    break;
	default:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "output type "
		    + deviceDataArgout.getType() + " not supported",
		    "CommandHelper.insertFromShort(Short value,deviceDataArgin)");
	    break;
	}

	return argout;
    }
93600
public void setAttributeValue(final IDeviceAttributeDAO devatt)
	    throws DevFailed {

	attrval.name = devatt.getName();
	attrval.quality = devatt.getQuality();
	attrval.time = devatt.getTimeVal();
	attrval.r_dim = devatt.getReadAttributeDim();
	attrval.w_dim = devatt.getWriteAttributeDim();
	attrval.r_dim.dim_x = devatt.getReadAttributeDim().dim_x;
	attrval.r_dim.dim_y = devatt.getReadAttributeDim().dim_y;

	if (devatt.getWriteAttributeDim() != null) {
	    attrval.w_dim.dim_x = devatt.getWriteAttributeDim().dim_x;
	    attrval.w_dim.dim_y = devatt.getWriteAttributeDim().dim_y;
	} else {
	    attrval.w_dim = devatt.getReadAttributeDim();// write as read
	}

	attrval.err_list = null;
	// Get the value from Union object
	attrval.value = ApiUtil.get_orb().create_any();
	// GA
	// devatt.setValueAsAny(this);
	((DeviceAttributeDAODefaultImpl) devatt).setValueAsAny(this);
    }
983381
public static Object[] extractArray(final DeviceAttribute deviceAttributeRead) throws DevFailed {
	Object[] argout = null;
	switch (deviceAttributeRead.getType()) {
	case TangoConst.Tango_DEV_SHORT:
	    final short[] simpleShortValues = deviceAttributeRead.extractShortArray();
	    argout = new Object[simpleShortValues.length];
	    for (int i = 0; i < simpleShortValues.length; i++) {
		argout[i] = Short.valueOf(simpleShortValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_USHORT:
	    final int[] simpleUshortValues = deviceAttributeRead.extractUShortArray();
	    argout = new Object[simpleUshortValues.length];
	    for (int i = 0; i < simpleUshortValues.length; i++) {
		argout[i] = Integer.valueOf(simpleUshortValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_CHAR:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "output type Tango_DEV_CHAR not supported",
		    "AttributeHelper.extractArray(deviceAttributeWritten)");
	    break;
	case TangoConst.Tango_DEV_UCHAR:
	    final byte[] byteValues = deviceAttributeRead.extractCharArray();
	    argout = new Object[byteValues.length];
	    for (int i = 0; i < byteValues.length; i++) {
		argout[i] = Byte.valueOf(byteValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_LONG:
	    final int[] simpleLongValues = deviceAttributeRead.extractLongArray();
	    argout = new Object[simpleLongValues.length];
	    for (int i = 0; i < simpleLongValues.length; i++) {
		argout[i] = Integer.valueOf(simpleLongValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_ULONG:
	    final long[] simpleUlongValues = deviceAttributeRead.extractULongArray();
	    argout = new Object[simpleUlongValues.length];
	    for (int i = 0; i < simpleUlongValues.length; i++) {
		argout[i] = Long.valueOf(simpleUlongValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_LONG64:
	    final long[] simpleLong64Values = deviceAttributeRead.extractLong64Array();
	    argout = new Object[simpleLong64Values.length];
	    for (int i = 0; i < simpleLong64Values.length; i++) {
		argout[i] = Long.valueOf(simpleLong64Values[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_ULONG64:
	    final long[] simpleUlong64Values = deviceAttributeRead.extractULong64Array();
	    argout = new Object[simpleUlong64Values.length];
	    for (int i = 0; i < simpleUlong64Values.length; i++) {
		argout[i] = Long.valueOf(simpleUlong64Values[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_INT:
	    final int[] simpleIntValues = deviceAttributeRead.extractLongArray();
	    argout = new Object[simpleIntValues.length];
	    for (int i = 0; i < simpleIntValues.length; i++) {
		argout[i] = Integer.valueOf(simpleIntValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_FLOAT:
	    final float[] simpleFloatValues = deviceAttributeRead.extractFloatArray();
	    argout = new Object[simpleFloatValues.length];
	    for (int i = 0; i < simpleFloatValues.length; i++) {
		argout[i] = Float.valueOf(simpleFloatValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_DOUBLE:
	    final double[] simpleDoubleValues = deviceAttributeRead.extractDoubleArray();
	    argout = new Object[simpleDoubleValues.length];
	    for (int i = 0; i < simpleDoubleValues.length; i++) {
		argout[i] = Double.valueOf(simpleDoubleValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_STRING:
	    final String[] simpleStringValues = deviceAttributeRead.extractStringArray();
	    argout = new Object[simpleStringValues.length];
	    for (int i = 0; i < simpleStringValues.length; i++) {
		argout[i] = simpleStringValues[i];
	    }
	    break;
	case TangoConst.Tango_DEV_BOOLEAN:
	    final boolean[] simpleBooleanValues = deviceAttributeRead.extractBooleanArray();
	    argout = new Object[simpleBooleanValues.length];
	    for (int i = 0; i < simpleBooleanValues.length; i++) {
		argout[i] = Boolean.valueOf(simpleBooleanValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_STATE:
	    argout = new Object[] { deviceAttributeRead.extractDevState() };
	    break;

	// Array input type
	case TangoConst.Tango_DEVVAR_SHORTARRAY:
	    final short[] shortValues = deviceAttributeRead.extractShortArray();
	    argout = new Object[shortValues.length];
	    for (int i = 0; i < shortValues.length; i++) {
		argout[i] = Short.valueOf(shortValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_USHORTARRAY:
	    final int[] ushortValues = deviceAttributeRead.extractUShortArray();
	    argout = new Object[ushortValues.length];
	    for (int i = 0; i < ushortValues.length; i++) {
		argout[i] = Integer.valueOf(ushortValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_CHARARRAY:
	    final byte[] charValues = deviceAttributeRead.extractCharArray();
	    argout = new Object[charValues.length];
	    for (int i = 0; i < charValues.length; i++) {
		argout[i] = Byte.valueOf(charValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_LONGARRAY:
	    final int[] longValues = deviceAttributeRead.extractLongArray();
	    argout = new Object[longValues.length];
	    for (int i = 0; i < longValues.length; i++) {
		argout[i] = Integer.valueOf(longValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_ULONGARRAY:
	    final long[] ulongValues = deviceAttributeRead.extractULongArray();
	    argout = new Object[ulongValues.length];
	    for (int i = 0; i < ulongValues.length; i++) {
		argout[i] = Long.valueOf(ulongValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_LONG64ARRAY:
	    final long[] long64Values = deviceAttributeRead.extractLong64Array();
	    argout = new Object[long64Values.length];
	    for (int i = 0; i < long64Values.length; i++) {
		argout[i] = Long.valueOf(long64Values[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_ULONG64ARRAY:
	    final long[] ulong64Values = deviceAttributeRead.extractULong64Array();
	    argout = new Object[ulong64Values.length];
	    for (int i = 0; i < ulong64Values.length; i++) {
		argout[i] = Long.valueOf(ulong64Values[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_FLOATARRAY:
	    final float[] floatValues = deviceAttributeRead.extractFloatArray();
	    argout = new Object[floatValues.length];
	    for (int i = 0; i < floatValues.length; i++) {
		argout[i] = Float.valueOf(floatValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_DOUBLEARRAY:
	    final double[] doubleValues = deviceAttributeRead.extractDoubleArray();
	    argout = new Object[doubleValues.length];
	    for (int i = 0; i < doubleValues.length; i++) {
		argout[i] = Double.valueOf(doubleValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_STRINGARRAY:
	    final String[] stringValues = deviceAttributeRead.extractStringArray();
	    argout = new Object[stringValues.length];
	    for (int i = 0; i < stringValues.length; i++) {
		argout[i] = stringValues[i];
	    }
	    break;

	case TangoConst.Tango_DEVVAR_LONGSTRINGARRAY:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "output type Tango_DEVVAR_LONGSTRINGARRAY not supported",
		    "AttributeHelper.insertFromShortArray(short[] values,deviceAttributeWritten)");
	    break;
	case TangoConst.Tango_DEVVAR_DOUBLESTRINGARRAY:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "output type Tango_DEVVAR_DOUBLESTRINGARRAY not supported",
		    "AttributeHelper.insertFromShortArray(short[] values,deviceAttributeWritten)");
	    break;

	default:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "output type "
		    + deviceAttributeRead.getType() + " not supported",
		    "AttributeHelper.insertFromShort(Short value,deviceAttributeWritten)");
	    break;
	}
	return argout;
    }
887601
public static void insertFromArray(final Object[] values, final DeviceData deviceDataArgin,
	    final int dataType) throws DevFailed {
	if (values.length > 0) {
	    final Object firstValue = values[0];
	    if (firstValue instanceof Short) {
		final short[] tmpValues = new short[values.length];
		for (int i = 0; i < tmpValues.length; i++) {
		    tmpValues[i] = ((Short) values[i]).shortValue();
		}
		CommandHelper.insertFromShortArray(tmpValues, deviceDataArgin, dataType);
	    } else if (firstValue instanceof String) {
		final String[] tmpValues = new String[values.length];
		for (int i = 0; i < tmpValues.length; i++) {
		    tmpValues[i] = (String) values[i];
		}
		CommandHelper.insertFromStringArray(tmpValues, deviceDataArgin, dataType);
	    } else if (firstValue instanceof Integer) {
		final int[] tmpValues = new int[values.length];
		for (int i = 0; i < tmpValues.length; i++) {
		    tmpValues[i] = ((Integer) values[i]).intValue();
		}
		CommandHelper.insertFromIntegerArray(tmpValues, deviceDataArgin, dataType);
	    } else if (firstValue instanceof Long) {
		final long[] tmpValues = new long[values.length];
		for (int i = 0; i < tmpValues.length; i++) {
		    tmpValues[i] = ((Long) values[i]).intValue();
		}
		CommandHelper.insertFromLongArray(tmpValues, deviceDataArgin, dataType);
	    } else if (firstValue instanceof Float) {
		final float[] tmpValues = new float[values.length];
		for (int i = 0; i < tmpValues.length; i++) {
		    tmpValues[i] = ((Float) values[i]).floatValue();
		}
		CommandHelper.insertFromFloatArray(tmpValues, deviceDataArgin, dataType);
	    } else if (firstValue instanceof Byte) {
		final byte[] tmpValues = new byte[values.length];
		for (int i = 0; i < tmpValues.length; i++) {
		    tmpValues[i] = ((Byte) values[i]).byteValue();
		}
		CommandHelper.insertFromByteArray(tmpValues, deviceDataArgin, dataType);
	    } else if (firstValue instanceof Boolean) {
		final boolean[] tmpValues = new boolean[values.length];
		for (int i = 0; i < tmpValues.length; i++) {
		    tmpValues[i] = ((Boolean) values[i]).booleanValue();
		}

		CommandHelper.insertFromBooleanArray(tmpValues, deviceDataArgin, dataType);
	    } else if (firstValue instanceof Double) {
		final double[] tmpValues = new double[values.length];
		for (int i = 0; i < tmpValues.length; i++) {
		    tmpValues[i] = ((Double) values[i]).doubleValue();
		}

		CommandHelper.insertFromDoubleArray(tmpValues, deviceDataArgin, dataType);
	    }
	}
    }
1125556
public void write_attribute(final DeviceProxy deviceProxy,
                                final DeviceAttribute[] deviceAttributes) throws DevFailed {
		checkIfTango(deviceProxy, "write_attribute");
		build_connection(deviceProxy);

		//
		// Manage Access control
		//
		if (deviceProxy.access == TangoConst.ACCESS_READ) {
	    	// ping the device to throw execption
	    	// if failed (for reconnection)
	    	ping(deviceProxy);

        	throwNotAuthorizedException(deviceProxy.devname + ".write_attribute()",
                	"DeviceProxy.write_attribute()");
		}
		// Build an AttributeValue IDL object array
        AttributeValue_4[] attributeValues_4 = new AttributeValue_4[0];
		AttributeValue[] attributeValues = new AttributeValue[0];

		if (deviceProxy.device_5 != null || deviceProxy.device_4 != null) {
	    	attributeValues_4 = new AttributeValue_4[deviceAttributes.length];
	    	for (int i=0 ; i<deviceAttributes.length ; i++) {
                attributeValues_4[i] = deviceAttributes[i].getAttributeValueObject_4();
	    	}
		} else {
	    	attributeValues = new AttributeValue[deviceAttributes.length];
	    	for (int i = 0; i < deviceAttributes.length; i++) {
                attributeValues[i] = deviceAttributes[i].getAttributeValueObject_2();
	    	}
		}
		boolean done = false;
		final int retries = deviceProxy.transparent_reconnection ? 2 : 1;
		for (int i = 0; i < retries && !done; i++) {
	    	// write attributes on device server
	    	try {
				if (deviceProxy.device_5 != null) {
		    		deviceProxy.device_5.write_attributes_4(
                            attributeValues_4, DevLockManager.getInstance().getClntIdent());
				} else
                if (deviceProxy.device_4 != null) {
		    		deviceProxy.device_4.write_attributes_4(
                            attributeValues_4, DevLockManager.getInstance().getClntIdent());
				} else
                if (deviceProxy.device_3 != null) {
		    		deviceProxy.device_3.write_attributes_3(attributeValues);
				} else {
		    		deviceProxy.device.write_attributes(attributeValues);
				}
				done = true;
	    	} catch (final DevFailed e) {
				// Except.print_exception(e);
				throw e;
	    	} catch (final MultiDevFailed e) {
				throw new NamedDevFailedList(e, name(deviceProxy),
						"DeviceProxy.write_attribute", "MultiDevFailed");
	    	} catch (final Exception e) {
				manageExceptionReconnection(deviceProxy, retries, i, e,
					this.getClass() + ".DeviceProxy.write_attribute");
	    	}
		} // End of for ( ; ; )
   	}
338142
public DeviceAttribute read_attribute(final DeviceProxy deviceProxy, final String attname)
	    throws DevFailed {
	final String[] names = ApiUtil.toStringArray(attname);
	final DeviceAttribute[] attval = read_attribute(deviceProxy, names);
	return attval[0];
    }