(String s)
| 30 | } |
| 31 | |
| 32 | private boolean isIPv6(String s) { |
| 33 | if (s.endsWith(":")) { |
| 34 | return false; |
| 35 | } |
| 36 | String[] ss = s.split(":"); |
| 37 | if (ss.length != 8) { |
| 38 | return false; |
| 39 | } |
| 40 | for (String t : ss) { |
| 41 | if (t.length() < 1 || t.length() > 4) { |
| 42 | return false; |
| 43 | } |
| 44 | for (char c : t.toCharArray()) { |
| 45 | if (!Character.isDigit(c) |
| 46 | && !"0123456789abcdefABCDEF".contains(String.valueOf(c))) { |
| 47 | return false; |
| 48 | } |
| 49 | } |
| 50 | } |
| 51 | return true; |
| 52 | } |
| 53 | |
| 54 | private int convert(String s) { |
| 55 | int x = 0; |
no test coverage detected