views:

48

answers:

2

I need a way to know if a string is Base64 encoded... any idea ?

thanks

+2  A: 
Nikolaus Gradwohl
+3  A: 

IMHO you need to try to decode it, and if it fails - it is not encoded.

There are many Base64 decoders for Java, here are some:

sun.misc.BASE64Decoder

Apache codec

http://migbase64.sourceforge.net/

http://www.source-code.biz/base64coder/java/

Frozen Spider