Home | History | Annotate | Download | only in util

Lines Matching refs:encoded

64     public static byte[] decode(String encoded) throws IllegalArgumentException {
65 return decode(encoded.toCharArray());
75 public static byte[] decode(String encoded, boolean allowSingleChar) throws IllegalArgumentException {
76 return decode(encoded.toCharArray(), allowSingleChar);
85 public static byte[] decode(char[] encoded) throws IllegalArgumentException {
86 return decode(encoded, false);
96 public static byte[] decode(char[] encoded, boolean allowSingleChar) throws IllegalArgumentException {
97 int resultLengthBytes = (encoded.length + 1) / 2;
103 if ((encoded.length % 2) != 0) {
105 result[resultOffset++] = (byte) toDigit(encoded, i);
109 if ((encoded.length % 2) != 0) {
110 throw new IllegalArgumentException("Invalid input length: " + encoded.length);
114 for (int len = encoded.length; i < len; i += 2) {
115 result[resultOffset++] = (byte) ((toDigit(encoded, i) << 4) | toDigit(encoded, i + 1));