Java String Decode decodeString(String str)

Here you can find the source of decodeString(String str)

Description

Decode a string using Base64 encoding.

License

Apache License

Parameter

Parameter Description
str a parameter

Exception

Parameter Description
IOException an exception

Return

String

Declaration

public static String decodeString(String str) throws IOException 

Method Source Code

//package com.java2s;

import java.io.IOException;

import sun.misc.BASE64Decoder;

public class Main {
    /**/*from   w w w .  ja v  a 2  s .c o  m*/
     * Decode a string using Base64 encoding.
     *
     * @param str
     * @return String
     * @throws IOException
     */
    public static String decodeString(String str) throws IOException {
        BASE64Decoder dec = new BASE64Decoder();
        String value = new String(dec.decodeBuffer(str));

        return (value);
    }
}

Related

  1. decode(String value, String encoding)
  2. decode3(String str)
  3. decodeString(String s)
  4. decodeString(String s, String charset)
  5. decodeString(String s, String encoding)
  6. decodeString(String str)
  7. decodeString(StringReader in)
  8. decodeStringFromByteArray(byte[] data)
  9. decodeStrings(byte[] stringBytes)