Hello ,
InputStream in= new ByteArrayInputStream(... some source byte array ...);
ByteArrayOutputStream out = new ByteArrayOutputStream();
com.aspose.words.Document doc = null;
int asposeOutputFormat=-1;
switch ( documentByteContent.getDestinationDocumentType().getNumber() ) {
case DocumentType.DOCTYPE_DOC_VALUE :
asposeOutputFormat=com.aspose.words.SaveFormat.DOC;
break;
case DocumentType.DOCTYPE_DOCX_VALUE :
asposeOutputFormat=com.aspose.words.SaveFormat.DOCX;
break;
case DocumentType.DOCTYPE_TXT_VALUE :
asposeOutputFormat=com.aspose.words.SaveFormat.TEXT;
break;
case DocumentType.DOCTYPE_RTF_VALUE :
asposeOutputFormat=com.aspose.words.SaveFormat.RTF;
break;
}
doc = new com.aspose.words.Document(in);
in.close();
doc.save(out, asposeOutputFormat);