Decodes part of a string generated by {@link #hexDump(byte[])}
488356
public static byte[] decodeHexDump(CharSequence hexDump, int fromIndex, int length) {
        return StringUtil.decodeHexDump(hexDump, fromIndex, length);
    }
1354236
static byte[] decode(byte[] decrypted) {
        int pad = (int) decrypted[decrypted.length - 1];
        if (pad < 1 || pad > 32) {
            pad = 0;
        }
        return Arrays.copyOfRange(decrypted, 0, decrypted.length - pad);
    }
1197478
String getHexString() {
        final ByteBuffer bytes = getBytes();
        final byte[] array = new byte[bytes.remaining()];
        bytes.get(array);
        final StringBuilder sb = new StringBuilder();
        for (byte b : array) {
            sb.append(String.format("%02x ", b));
        }
        return sb.toString();
    }
331708
public static byte[] fromHexString(String s) {
		if (s.length() % 2 != 0) {
			throw new IllegalArgumentException(s);
		}
		byte[] array = new byte[s.length() / 2];
		for (int i = 0; i < array.length; i++) {
			int b = Integer.parseInt(s.substring(i * 2, i * 2 + 2), SIXTEEN);
			array[i] = (byte) (_0XFF & b);
		}
		return array;
	}
444900
public static String decode(String s) {
    StringBuilder b = new StringBuilder();
    int[] eatLength = new int[1];
    while (s.length() > 0) {
      char c = eatPercentage(s, eatLength);
      if (eatLength[0] <= 0) {
        c = eatAmpersand(s, eatLength);
        if (eatLength[0] <= 0) {
          c = eatBackslash(s, eatLength);
          if (eatLength[0] <= 0) {
            c = eatUtf8(s, eatLength);
            if (eatLength[0] <= 0) {
              c = s.charAt(0);
              eatLength[0] = 1;
            }
          }
        }
      }
      b.append(c);
      s = s.substring(eatLength[0]);
    }
    return (b.toString());
  }
875954
function decode(string, tag) {

    tag = tag || '\\u';

    var newString = '';
    var open = false;
    var char, charCode;
    var index = -1;
    var length = string.length;
    while (++index < length) {
        char = string.charAt(index);
        charCode = char.charCodeAt(0);
        if (open) {
            if (char === tag) {
                newString += tag;
            } else {
                var hex = parseInt(string.substr(index, 4), 16);
                if (isNaN(hex)) {
                    newString += char;
                } else {
                    newString += String.fromCharCode(hex);
                    index += 3;
                }
            }
            open = false;
        } else {
            if (char === tag) {
                open = true;
            } else {
                newString += char;
            }
        }
    }

    return newString;

}
748181
public static byte[] decodeHex(String hexStr) {
		if (StrUtil.isEmpty(hexStr)) {
			return null;
		}
		return decodeHex(hexStr.toCharArray());
	}
221564
public Map<String, String> decode(byte[] bytes) throws DeserializationException {
        Map<String, String> map = new HashMap<String, String>();
        if (bytes == null || bytes.length == 0) {
            return map;
        }

        UnsafeByteArrayInputStream in = new UnsafeByteArrayInputStream(bytes);
        try {
            while (in.available() > 0) {
                String key = readString(in);
                String value = readString(in);
                map.put(key, value);
            }
            return map;
        } catch (IOException ex) {
            throw new DeserializationException(ex.getMessage(), ex);
        }
    }
758629
public static String decodeUTF8(String s) {
    StringBuilder result = new StringBuilder();
    int[] eatLength = new int[1];
    while (s.length() != 0) {
      char c = eatUtf8(s, eatLength);
      if (eatLength[0] != -1) {
        result.append(c);
        s = s.substring(eatLength[0]);
      } else {
        result.append(s.charAt(0));
        s = s.substring(1);
      }
    }
    return (result.toString());
  }
85799
public static String hexDump(byte[] array, int offset, int length) {
            if (length < 0) {
              throw new IllegalArgumentException("length: " + length);
            }
            if (length == 0) {
                return EMPTY_STRING;
            }
            int endIndex = offset + length;
            char[] buf = new char[length << 1];

            int srcIdx = offset;
            int dstIdx = 0;
            for (; srcIdx < endIndex; srcIdx ++, dstIdx += 2) {
                System.arraycopy(
                    HEXDUMP_TABLE, (array[srcIdx] & 0xFF) << 1,
                    buf, dstIdx, 2);
            }
            return new String(buf);
        }
461207
String decodeCString(ByteBuf buffer) throws IOException {
        int length = buffer.bytesBefore(BsonConstants.STRING_TERMINATION);
        if (length < 0)
            throw new IOException("string termination not found");

        String result = buffer.toString(buffer.readerIndex(), length, StandardCharsets.UTF_8);
        buffer.skipBytes(length + 1);
        return result;
    }
1352163
@Override
	public T decode(byte[] bytes) throws IOException {
		if (bytes == null) {
			throw new IOException("byte array is null.");
		}
		CodedInputStream input = CodedInputStream.newInstance(bytes, 0, bytes.length);

		return readFrom(input);
	}
174518
public static byte[] decodeHex(final String data) {

        checkNotNull("data", data);

        final int len = data.length();

        if ((len & 0x01) != 0) {
            throw new RuntimeException("Odd number of characters.");
        }

        final byte[] out = new byte[len >> 1];

        // two characters form the hex value.
        for (int i = 0, j = 0; j < len; i++) {
            int f = toDigit(data.charAt(j), j) << 4;
            j++;
            f = f | toDigit(data.charAt(j), j);
            j++;
            out[i] = (byte) (f & 0xFF);
        }

        return out;
    }
242037
public static byte[] decode(String text) throws Exception
	{
		if (text.length() % 4 != 0)
		{
			throw new Exception("Base64 not a multiple of 4 bytes");
		}

		byte[] result = new byte[text.length() / 4 * 3];
		int p = 0;

		for (int i = 0; i < text.length();)
		{
			if (text.charAt(i) == '\n')
			{
				continue;
			}

			int b1 = b64decode(text.charAt(i++));
			int b2 = b64decode(text.charAt(i++));
			int b3 = b64decode(text.charAt(i++));
			int b4 = b64decode(text.charAt(i++));

			if (b4 >= 0)
			{
				int three = b4 | b3 << 6 | b2 << 12 | b1 << 18;
				result[p++] = (byte) ((three & 0xff0000) >> 16);
				result[p++] = (byte) ((three & 0xff00) >> 8);
				result[p++] = (byte) (three & 0xff);
			} else if (b3 >= 0)
			{
				int two = b3 << 6 | b2 << 12 | b1 << 18;
				result[p++] = (byte) ((two & 0xff0000) >> 16);
				result[p++] = (byte) ((two & 0xff00) >> 8);
			} else
			{
				int one = b2 << 12 | b1 << 18;
				result[p++] = (byte) ((one & 0xff0000) >> 16);
			}
		}

		byte[] output = new byte[p];
		System.arraycopy(result, 0, output, 0, p);

		return output;
	}
383876
private static String byteToHexString(byte[] bytes)
  {
    final char[] hexArray = "0123456789ABCDEF".toCharArray();
    char[] hexChars = new char[bytes.length * 2];
    for (int j = 0; j < bytes.length; j++)
    {
      int v = bytes[j] & 0xFF;
      hexChars[j * 2] = hexArray[v >>> 4];
      hexChars[j * 2 + 1] = hexArray[v & 0x0F];
    }
    return new String(hexChars);
  }
1317107
public static byte[] decode(String hexa) throws CoderException {
	if (hexa == null) {
	    throw new CoderException("can't decode empty String");
	}
	if ((hexa.length() % 2) != 0) {
	    throw new CoderException("invalid hexadecimal String");
	}
	int tamArray = hexa.length() / 2;
	byte[] retorno = new byte[tamArray];
	for (int i = 0; i < tamArray; i++) {
	    retorno[i] = hexToByte(hexa.substring(i * 2, i * 2 + 2));
	}
	return retorno;
    }
532467
public static String hexDump(ByteBuf buffer) {
        return hexDump(buffer, buffer.readerIndex(), buffer.readableBytes());
    }