// Base 64 encode
Base64OutputStreamWriter bos =
new Base64OutputStreamWriter(bytes.length, writer);
bos.write(bytes, 0, bytes.length);
bos.finish();
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE,
"Client State: total number of characters written: {0}",
bos.getTotalCharsWritten());