Java Utililty Methods String Decode

List of utility methods to do String Decode

Description

The list of methods to do String Decode are organized into topic(s).

Method

Stringdecode(String bytes)
decode
ByteArrayOutputStream baos = new ByteArrayOutputStream(bytes.length() / 2);
for (int i = 0; i < bytes.length(); i += 2)
    baos.write(hexString.indexOf(bytes.charAt(i)) << 4 | hexString.indexOf(bytes.charAt(i + 1)));
return new String(baos.toByteArray());
byte[]decode(String cipherText)
decode
return DECODER.decodeBuffer(cipherText);
byte[]decode(String in)
Base 64 decodes the specified string.
int len = in.length();
if (len % 4 != 0) {
    throw new IOException("Length of base 64 encoded string must be a multiple of 4");
while (len > 0 && in.charAt(len - 1) == '=') {
    len--;
int oLen = (len * 3) / 4;
...
Stringdecode(String name)
decode
StringBuilder sb = new StringBuilder();
for (int i = 0; i < name.length(); i++) {
    char c = name.charAt(i);
    if (c != '_')
        sb.append(c);
    else {
        c = (char) Integer.parseInt(name.substring(i + 1, i + 3), 16);
        sb.append(c);
...
JsonStructuredecode(String s)
Obtain a JsonStructure from a String.
if (s == null || s.isEmpty()) {
    return null;
final StringReader r = new StringReader(Objects.requireNonNull(s));
try (JsonReader jr = Json.createReader(r)) {
    return jr.read();
JsonNodedecode(String s)
decode
return om.readTree(s);
Stringdecode(String s)
decode
boolean needToChange = false;
StringBuffer sb = new StringBuffer();
int numChars = s.length();
int i = 0;
while (i < numChars) {
    char c = s.charAt(i);
    switch (c) {
    case '+':
...
Stringdecode(String s)
Copied from URLDecoder.java
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
    char c = s.charAt(i);
    switch (c) {
    case '+':
        sb.append(' ');
        break;
    case '%':
...
Stringdecode(String s)
decode
if (s != null) {
    return new String(xorWithKey(base64Decode(s), "HELIUMV".getBytes()));
} else {
    return null;
Tdecode(String s)
decode
byte[] decode = Base64.getDecoder().decode(s);
try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(decode);
        ObjectInputStream si = new ObjectInputStream(byteArrayInputStream)) {
    return (T) si.readObject();
} catch (ClassNotFoundException | IOException e) {
    throw new UnsupportedOperationException(e);