I want to write base64-encoded data to a file, decoding on the fly. I have
BufferedWriter bw = new BufferedWriter(
new OutputStreamWriter(
new Base64OutputStream(
new FileOutputStream(myFile, false)));
I think this works, and in my finally
block I call bw.close()
-- that is, close the outermost wrapper. Is that enough, or are some of the anonymous intermediary objects going to leak?
I tried looking through the code but I got stuck at Sun's proprietary implementation of OutputStreamWriter's encoding-handlers. It also doesn't appear to be spelled out explicitly in the documentation.