if (input instanceof noHeaderInput) ((noHeaderInput) input).subsequentCalls = false;
if (input instanceof HeadlessInput) ((HeadlessInput) input).subsequentCalls = false;
  public static Serializable readValue(InputStream input, final int position,    Object value, BoxedValueHelper helper, String id, String[] ids,    String codebase)      {    gnuRuntime g;    gnuValueStream c = ((gnuValueStream) input);    if (c.getRunTime() == null)      {        g = new gnuRuntime(codebase, value);        c.setRunTime(g);      }    else      {        g = c.getRunTime();        g.addCodeBase(codebase);        g.target = (Serializable) value;      }    if (value != null)      g.objectWritten(value, position);    if (input instanceof noHeaderInput)      ((noHeaderInput) input).subsequentCalls = false;    boolean ok = true;    // The user-defined io operations are implemented.    if (value instanceof CustomMarshal)      {        CustomMarshal marsh = (CustomMarshal) value;            marsh.unmarshal((DataInputStream) input);          }    else    // The IDL-generated io operations are implemented.    if (value instanceof Streamable)      {        ((Streamable) value)._read(input);      }    else if (helper != null)      {        // If helper is non-null the value should normally be null.        value = helper.read_value(input);        g.objectWritten(value, position);      }    else      {        ok = false;        ValueFactory factory = null;        org.omg.CORBA_2_3.ORB orb = (org.omg.CORBA_2_3.ORB) input.orb();        if (id != null)          factory = orb.lookup_value_factory(id);        if (factory == null && ids != null)          {            for (int i = 0; i < ids.length && factory == null; i++)              {                factory = orb.lookup_value_factory(ids[i]);              }          }        if (factory != null)          {            value = factory.read_value((org.omg.CORBA_2_3.portable.InputStream) input);            ok = true;          }      }    if (!ok && value instanceof Serializable)    // Delegate to ValueHandler      {        if (ids != null && ids.length > 0)          id = ids[0];        value = handler.readValue(input, position, value.getClass(), id, g);        ok = true;      }    if (!ok)      {        if (value != null)          {            MARSHAL m = new MARSHAL(value.getClass().getName()            + " must be Streamable, CustomMarshal or Serializable");            m.minor = Minor.UnsupportedValue;            throw m;          }        else      {            MARSHAL m = new MARSHAL("Unable to instantiate " + id + ":" + list(ids)            + " helper " + helper);            m.minor = Minor.UnsupportedValue;            throw m;          }      }    else      return (Serializable) value;      }