The explanations in this article are pretty good...
http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/
and there's always the good 'ole sun tutorials ...
and then there's your new best friend... Google...
Having said that, I think I'd probably use a PrintWriter ... something like this ...
private static int writeUnicode_PrintWriter(String fileName) {
//Approach 4: PrintWriter - handles Unicode chars properly.
try {
FileOutputStream fos = new FileOutputStream(fileName);
OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF8");
PrintWriter pw = new PrintWriter(osw);
pw.println("\uffff\u4321\u1234");
pw.close();
} catch (IOException e) {
System.err.println(e);
}
return(0);
}
and then of course there's the XML option, which (just maybe) made easier with apache's XmlBeans.
Good luck. Keith.