OLD | NEW |
1 part of webdriver; | |
2 | |
3 /** | 1 /** |
4 * A simple base64 decoder class, used to decode web browser screenshots | 2 * A simple base64 decoder class, used to decode web browser screenshots |
5 * returned by WebDriver. | 3 * returned by WebDriver. |
6 */ | 4 */ |
7 class Base64Decoder { | 5 class Base64Decoder { |
8 | 6 |
9 static int getVal(String s, pos) { | 7 static int getVal(String s, pos) { |
10 int code = s.charCodeAt(pos); | 8 int code = s.charCodeAt(pos); |
11 if (code >= 65 && code < (65+26)) { // 'A'..'Z' | 9 if (code >= 65 && code < (65+26)) { // 'A'..'Z' |
12 return code - 65; | 10 return code - 65; |
(...skipping 29 matching lines...) Expand all Loading... |
42 (getVal(s, pos + 2) << 6) | getVal(s, pos+3); | 40 (getVal(s, pos + 2) << 6) | getVal(s, pos+3); |
43 pos += 4; | 41 pos += 4; |
44 rtn.add((v >> 16 ) & 0xff); | 42 rtn.add((v >> 16 ) & 0xff); |
45 rtn.add((v >> 8) & 0xff); | 43 rtn.add((v >> 8) & 0xff); |
46 rtn.add(v & 0xff); | 44 rtn.add(v & 0xff); |
47 } | 45 } |
48 } | 46 } |
49 return rtn; | 47 return rtn; |
50 } | 48 } |
51 } | 49 } |
OLD | NEW |