TIMOB-15594-Used Base64OutputStream to encode

Used Base64OutputStream to properly encode the bytes.

https://jira.appcelerator.org/browse/TIMOB-15594