1 | static byte[] byteArrayFromShorts_littleEndian(short[] a) { |
2 | ret byteArrayFromShorts_littleEndian(a, 0, l(a)); |
3 | } |
4 | |
5 | static byte[] byteArrayFromShorts_littleEndian(short[] a, int from, int to) { |
6 | byte[] b = new byte[(to-from)*2]; |
7 | for (int i = 0; i < a.length; i++) { |
8 | short s = a[from+i]; |
9 | b[i*2] = (byte) s; |
10 | b[i*2+1] = (byte) (s >> 8); |
11 | } |
12 | ret b; |
13 | } |
Began life as a copy of #1007030
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1019649 |
Snippet name: | byteArrayFromShorts_littleEndian |
Eternal ID of this version: | #1019649/4 |
Text MD5: | 15da753724cfe6d483c937f2c7f2b5c4 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-11-16 03:21:20 |
Source code size: | 374 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 358 / 415 |
Version history: | 3 change(s) |
Referenced in: | [show references] |