i´m currently working on a project, with following architecture:
project A (shall storage files into a folder. Shall take byte[] and name and should write the data in a file. Not more, just a dumb file-writer application)
project B (shall read data from database, generates a xml file of it and sends that as byte[] to project A, which writes this in filesystem)
Now my problem: In project B, i want to generate the xml-file as an object, but the API of the Jaxb-Marshaller gives only marshal() methods, which takes as argument a Writer/File/OutputStream...And i don´t want to give a File or OutputStream in the project B- this should be task of Project A...
So why is there no method which returns the generated XML as Object or as byte[] or else?
Pass in ByteArrayOutputStream. Then you can convert it to
byte[]
using toByteArray()