1 | static byte[] charsToDoubleBytes(S s) {
|
2 | byte[] b = new byte[l(s)*2]; |
3 | for (int i = 0; i < l(s); i++) {
|
4 | int x = (int) s.charAt(i); |
5 | b[i*2] = (byte) (x >> 8); |
6 | b[i*2+1] = (byte) x; |
7 | } |
8 | ret b; |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1005035 |
| Snippet name: | charsToDoubleBytes |
| Eternal ID of this version: | #1005035/1 |
| Text MD5: | dea1648cd3ad9ae878047b3c2ad8d0ea |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2016-09-29 13:44:42 |
| Source code size: | 214 bytes / 9 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 753 / 773 |
| Referenced in: | [show references] |