Java String Decode decodeString(String s, String encoding)

Here you can find the source of decodeString(String s, String encoding)

Description

decode String

License

Apache License

Declaration

public static byte[] decodeString(String s, String encoding) 

Method Source Code

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

import java.io.UnsupportedEncodingException;

public class Main {
    public static byte[] decodeString(String s, String encoding) {
        if (s == null)
            return null;
        try {/*from   w  w w  . j a  v  a 2  s .c o  m*/
            return s.getBytes(encoding);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException("Unsupported encoding " + encoding,
                    e);
        }
    }
}

Related

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