Wrapping Unbuffered Writes to an OutputStreamWriter in Java
Writer w = new OutputStreamWriter(os, “UTF-8”);while (…){ w.write(“something”);} OutputStreamWriter uses memory for each call to its write() methods. This is why it is better to avoid this; if you do