title: Need to Merge two ByteArrayOutputStream to generate single ByteArrayOutputStream
body: <p>I need to merge two ByteArrayOutputStream and pass to xdo api TemplateHelper.processTemplate to generate report </p>
  
  <p>Following code is written to get xml output in two ByteArrayOutputStreams -</p>
  
  <pre><code>ByteArrayOutputStream hdrclob = new ByteArrayOutputStream (1024);
  
  hdrclob = (ByteArrayOutputStream)this.getDataTemplateXML(transaction,"ASO",
                        "ASOPD",parameters1,null);
  
  ByteArrayOutputStream conclob = new ByteArrayOutputStream (1024);
  
  ContractTermsXMLGenerator.writeXML(PrintQuote,(OutputStream) conclob, true,
              documentType, new Number(params[8]), new Number("0"));
  </code></pre>
  
  <p>Now passing hdrclob / conclob separately to xdo api then able to see respective xml output on separate reports like this -</p>
  
  <pre><code>TemplateHelper.processTemplate(((OADBTransactionImpl)transaction).getAppsContext(),
          "ASO", "SampleRTF", language, country,
           new ByteArrayInputStream(hdrclob.toByteArray()),
             TemplateHelper.OUTPUT_TYPE_PDF, new Properties(), pdf);    
  </code></pre>
  
  <p>Or </p>
  
  <pre><code>TemplateHelper.processTemplate(((OADBTransactionImpl)transaction).getAppsContext(),
           "ASO", "SampleRTF", language, country, 
           new ByteArrayInputStream(conclob.toByteArray()),
             TemplateHelper.OUTPUT_TYPE_PDF, new Properties(), pdf);  
  </code></pre>
  
  <p>But need to merge both hdrclob and conclob to generate single ByteArrayOutputStream and pass to xdo api to get single report containing both xml outputs</p>
  
  <p>Please tell how to merge two ByteArrayOutputStreams</p>
  
  <p>thanks for replying on this</p>