streda 15. augusta 2012

BASE64decode String in java

sInput is base64 encoded string


private String decodeBase64(String sInput){
String sReturn = "";
        BASE64Decoder decoder = new BASE64Decoder();
        try {
          byte[] decodedBytes = decoder.decodeBuffer(sInput);
          sReturn = new String(decodedBytes);
        } catch (IOException e) {
          e.printStackTrace();
        }
        
        return sReturn;
}

Žiadne komentáre:

Zverejnenie komentára