In a program, I currently have
process.serialize(System.out);
This generally output the object “process” to the screen in a XML format.
But I want to redirect this XML format into a saved file, like test.XML. How to do that in java? Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
System.outis a ofPrintStreamtype so you should have a look here.Using
PrintStreamcombined with aFilelike this:will do the work.