0
단순히 ArrayList를 XML 파일로 덤프 할 수 있습니까?arraylist를 XML 파일로 저장
다양한 유형의 메시지 객체를 포함하는 배열 목록이 있습니다.
로그를 유지하려면 XML 파일에 저장하십시오.
내가 시도한 것은 이것입니다.
public void saveConversation()
{
FileOutputStream f_out;
try {
f_out = new FileOutputStream("convo.txt");
// Write object with ObjectOutputStream
ObjectOutputStream obj_out = new ObjectOutputStream (f_out);
// Write object out to disk
obj_out.writeObject (convo);
} catch (IOException ex) {
Logger.getLogger(HunterCom.class.getName()).log(Level.SEVERE, null, ex);
}
}
작성된 파일은별로 영향을주지 않습니다. 이것을 읽을 수있는 XML로 바꿀 수있는 간단한 방법이 있는지 궁금합니다.
도움이 될 수 있습니다. http://stackoverflow.com/questions/3024105/how-to-generate-xml-in-string-representation-in-java – bakkal