Nov 8, 2009

Base64 Encode And Decode

free web hosting
Open Discussion > MODERATED AREA > Computers > Programming Languages > Java, Java Servlets, Java Script, & JSP

Base64 Encode And Decode

clemen
Hi,

Is there a Base64 method from J2SE 1.4 API that can decode and encode a string?

TIA.

Comment/Reply (w/o sign-up)

bjrn
I read a claim that there was a method in java.util.prefs, but otherwise it seems like people have just gone and made their own classes and/or methods. I've also head that there is an undocumented method called sun.misc.BASE64Encoder.encode.

Anyway, if you want some Base64 encoding/decoding I suggest you either make your own class to handle it, or download any of the ones you find by googling for java base64.

Comment/Reply (w/o sign-up)

acidrain
Use Commons Codec from Apache Site
http://jakarta.apache.org/commons/codec/

in package org.apache.commons.codec.binary
there is one class Base64

use static method :
* decodeBase64(byte[] base64Data)
* encodeBase64(byte[] binaryData)
* and be careful it works in array of bytes not String
* so beware of character encoding for Converting between your String to array of bytes.

Hopes this help you.

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Base64 Encode Decode


    Looking for base64, encode, decode

Searching Video's for base64, encode, decode
See Also,
advertisement


Base64 Encode And Decode

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com