I need to merge two ByteArrayOutputStream and pass to xdo api TemplateHelper.processTemplate to generate report
Following code is written to get xml output in two ByteArrayOutputStreams -
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"));
Now passing hdrclob / conclob separately to xdo api then able to see respective xml output on separate reports like this -
TemplateHelper.processTemplate(((OADBTransactionImpl)transaction).getAppsContext(),
"ASO", "SampleRTF", language, country,
new ByteArrayInputStream(hdrclob.toByteArray()),
TemplateHelper.OUTPUT_TYPE_PDF, new Properties(), pdf);
Or
TemplateHelper.processTemplate(((OADBTransactionImpl)transaction).getAppsContext(),
"ASO", "SampleRTF", language, country,
new ByteArrayInputStream(conclob.toByteArray()),
TemplateHelper.OUTPUT_TYPE_PDF, new Properties(), pdf);
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
Please tell how to merge two ByteArrayOutputStreams
thanks for replying on this