| 226 | } |
| 227 | |
| 228 | static private int readUnicodeChar(String token, int offset, int length, int base) { |
| 229 | if(token.length() != offset + length) |
| 230 | throw new IllegalArgumentException("Invalid unicode character: \\" + token); |
| 231 | int uc = 0; |
| 232 | for(int i = offset; i < offset + length; ++i) |
| 233 | { |
| 234 | int d = Character.digit(token.charAt(i), base); |
| 235 | if(d == -1) |
| 236 | throw new IllegalArgumentException("Invalid digit: " + token.charAt(i)); |
| 237 | uc = uc * base + d; |
| 238 | } |
| 239 | return (char) uc; |
| 240 | } |
| 241 | |
| 242 | static private int readUnicodeChar(PushbackReader r, int initch, int base, int length, boolean exact) { |
| 243 | int uc = Character.digit(initch, base); |