public static String encodeString(String src) {
return encode(src);
}
public static String encodeBytes(byte[] src) {
byte[] bytes = encode(src);return new String(bytes);
}
public static String encode(String src) {
String target = null;
if (src != null) {
byte[] bts1 = src.getBytes();
byte[] bts2 = encode(bts1);
if (bts2 != null) {
target = new String(bts2);
}
}
return target;
}
public static String decode(String src) {
String target = null;
if (src != null) {
byte[] bts1 = src.getBytes();
byte[] bts2 = decode(bts1);
if (bts2 != null) {
target = new String(bts2);
}
}
return target;
}
public static String decode(String src, String charSet) throws UnsupportedEncodingException {
String target = null;
if (src != null) {
byte[] bts1 = src.getBytes();
byte[] bts2 = decode(bts1);
if (bts2 != null) {
target = new String(bts2, charSet);
}
}
return target;
}