public AbstractHessianOutput getHessianOutput(OutputStream os) {
    AbstractHessianOutput out;

    if (_isHessian2Request) out = new Hessian2Output(os);
    else {
      HessianOutput out1 = new HessianOutput(os);
      out = out1;

      if (_isHessian2Reply) out1.setVersion(2);
    }

    out.setSerializerFactory(getSerializerFactory());

    return out;
  }