if (details instanceof cdrOutput) ((cdrOutput) details).cloneSettings(output);
if (details instanceof AbstractCdrOutput) ((AbstractCdrOutput) details).cloneSettings(output);
  public static ServiceContext[] addExceptionContext(ServiceContext[] current,    Throwable exception, Object details)  {    try      {        ServiceContext[] c = new ServiceContext[current.length + 1];        if (current.length > 0)          System.arraycopy(current, 0, c, 0, current.length);        cdrBufOutput output = new cdrBufOutput();        if (details instanceof OutputStream)          output.setOrb(((OutputStream) output).orb());        if (details instanceof cdrOutput)          ((cdrOutput) details).cloneSettings(output);        write(output, exception);        ServiceContext xc = new ServiceContext();        xc.context_id = ServiceContext.UnknownExceptionInfo;        xc.context_data = output.buffer.toByteArray();        c[current.length] = xc;        return c;      }    catch (Exception ex)      {        ex.printStackTrace();        return current;      }  }