if (helper instanceof BoxedValueHelper)
if ((value_tag & vf_MULTIPLE_IDS) != 0) write_string_array(output, (String[]) ids); else if ((value_tag & vf_ID) != 0) write_string(output, (String) ids);  if (USE_CHUNKING)
  private static void write_instance(OutputStream output, Serializable value,                                     String id, Object helper                                    )  {    // This implementation always writes a single repository id.    // It never writes multiple repository ids and currently does not use    // a codebase.    int value_tag = vt_VALUE_TAG | vf_ID;    OutputStream outObj;    cdrBufOutput out = null;    if (USE_CHUNKING)      {        out = new cdrBufOutput();        out.setOrb(output.orb());        outObj = out;        value_tag |= vf_CHUNKING;      }    else      outObj = output;    output.write_long(value_tag);    output.write_string(id);    if (helper instanceof BoxedValueHelper)      {        ((BoxedValueHelper) helper).write_value(outObj, value);      }    else    // User defince write method is present.    if (value instanceof CustomMarshal)      {        try          {            ((CustomMarshal) value).marshal((DataOutputStream) outObj);          }        catch (ClassCastException ex)          {            incorrect_plug_in(ex);          }      }    else if (value instanceof Streamable)      {        ((Streamable) value)._write(outObj);      }    else      {        // Try to find helper via class loader.        boolean ok = false;        try          {            Class helperClass = Class.forName(ObjectCreator.toHelperName(id));            // It will be the helper for the encapsulated boxed value, not the            // for the global boxed value type itself.            Method write =              helperClass.getMethod("write",                                    new Class[]                                    {                  org.omg.CORBA.portable.OutputStream.class, value.getClass()                                    }                                   );            write.invoke(null, new Object[] { outObj, value });            ok = true;          }        catch (Exception ex)          {            ok = false;          }      // Stating the interfaces that the USER should use.        if (!ok)      throw new MARSHAL("The " + value.getClass().getName() +            " must implement either StreamableValue" + " or CustomValue."                       );      }    if (USE_CHUNKING)      {        output.write_long(out.buffer.size());        try          {            out.buffer.writeTo(output);          }        catch (IOException ex)          {            MARSHAL m = new MARSHAL();            m.initCause(ex);            throw m;          }      }    // The end of record marker, required by OMG standard.    output.write_long(-1);  }