Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1005035 // charsToDoubleBytes

JavaX fragment (include)

static byte[] charsToDoubleBytes(S s) {
  byte[] b = new byte[l(s)*2];
  for (int i = 0; i < l(s); i++) {
    int x = (int) s.charAt(i);
    b[i*2] = (byte) (x >> 8);
    b[i*2+1] = (byte) x;
  }
  ret b;
}

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: 535 / 543
Referenced in: [show references]