How to encode decode String in Java base64 Encoding

Encoding and Decoding of String in Java using base64 is extremely easy if you are using Apache commons code open source library. it provides convenient static utility method Base64.encodeBase64(byte[]) and Base64.decodeBase64(byte []) for converting binary data into base64 encoded binary Stream and than decoding back from encoded data in base64 encoding mechanism. Many times we need to encode sensitive data be it binary String  format transferring over socket or transferring or storing data in xml files. Though there are other open source library available which provides support to encode any String into base64 e.g. MimeUtil from javax.mail package but Apache commons codec package is really handy and doesn't add lot of extra stuff. its API is also very neat and clean. In this article we will see how to encode and decode String into base64 encoding.
Read more »

0 Response to "How to encode decode String in Java base64 Encoding"

Posting Komentar