/** * Write the array to the input stream. */ public void write_value(OutputStream output, Serializable value) { if (output instanceof gnuValueStream) { gnuRuntime r = ((gnuValueStream) output).getRunTime(); if (r != null) r.target = null; } if (value instanceof byte[]) OctetSeqHelper.write(output, (byte[]) value); else if (value instanceof String[]) { String[] s = (String[]) value; output.write_long(s.length); for (int i = 0; i < s.length; i++) Vio.write(output, s[i], Vio.m_StringValueHelper); } else if (value instanceof int[]) LongSeqHelper.write(output, (int[]) value); else if (value instanceof long[]) LongLongSeqHelper.write(output, (long[]) value); else if (value instanceof double[]) DoubleSeqHelper.write(output, (double[]) value); else if (value instanceof float[]) FloatSeqHelper.write(output, (float[]) value); else if (value instanceof boolean[]) BooleanSeqHelper.write(output, (boolean[]) value); else if (value instanceof short[]) ShortSeqHelper.write(output, (short[]) value); else if (value instanceof char[]) CharSeqHelper.write(output, (char[]) value); else { // Write others, use reflection. component = arrayClass.getComponentType(); int n = Array.getLength(value); output.write_long(n); if (written_as_object()) for (int i = 0; i < n; i++) { Object o = Array.get(value, i); if (o == null) output.write_Object(null); else // CORBA objects have another notation. handler.writeValue(output, (Serializable) o); } else { for (int i = 0; i < n; i++) Vio.write(output, (Serializable) Array.get(value, i), component); } } }