hey everyone a quick buffered writter question
I am writting an XML parser and am trying to add tabs to the .write() function of the buffered writter what is the best way of doing this?
here is my code:
Code:
public void writeXML() {
try {
File fileToWrite = new File(
"C:\\Documents and Settings\\userName\\Desktop\\new_games.xml");
FileWriter fileWriter = new FileWriter(fileToWrite);
BufferedWriter writer = new BufferedWriter(fileWriter);
for (int i = 0; i < gameList.size(); i++) {
Game game = gameList.get(i);
writer.write("'<?xml version="+" 1.0'"+"' encoding="+"ISO-8859-1'"+"?> ");
writer.write("[COLOR="Red"]NEED TABS HERE !!<[/COLOR]gamelist>");
writer.write(game.getGameName());
writer.newLine();
writer.newLine();
writer.newLine();
writer.flush();
}
} catch (Exception e) {
e.printStackTrace();
}
}