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

Return

String

Declaration

public static String decodeString(String str) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.IOException;

public class Main {
    /**//from   w w  w.  j  a  v  a 2  s. c o m
     * Decode a string using Base64 encoding.
     *
     * @param str
     * @return String
     */
    public static String decodeString(String str) {
        sun.misc.BASE64Decoder dec = new sun.misc.BASE64Decoder();
        try {
            return new String(dec.decodeBuffer(str));
        } catch (IOException io) {
            throw new RuntimeException(io.getMessage(), io.getCause());
        }
    }
}

Related

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