Libraryless. Click here for Pure Java version (3809L/22K).
static byte[] subByteArray(byte[] b, int start) { ret subByteArray(b, start, l(b)); } static byte[] subByteArray(byte[] b, int start, int end) { start = max(start, 0); end = min(end, l(b)); if (start == 0 && end == l(b)) ret b; if (start >= end) ret new byte[0]; byte[] x = new byte[end-start]; System.arraycopy(b, start, x, 0, end-start); ret x; } ifclass IntRange static byte[] subByteArray(byte[] b, IntRange r) { ret r == null ?: subByteArray(b, r.start, r.end); } endif
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1014874 | 
| Snippet name: | subByteArray | 
| Eternal ID of this version: | #1014874/5 | 
| Text MD5: | 3bdc625d1722eb26bfb7c1c89ae8640b | 
| Transpilation MD5: | 08c70273fb665aaaa651c2ad6ad91745 | 
| Author: | stefan | 
| Category: | |
| Type: | JavaX fragment (include) | 
| Public (visible to everyone): | Yes | 
| Archived (hidden from active list): | No | 
| Created/modified: | 2021-10-10 22:32:22 | 
| Source code size: | 511 bytes / 18 lines | 
| Pitched / IR pitched: | No / No | 
| Views / Downloads: | 793 / 925 | 
| Version history: | 4 change(s) | 
| Referenced in: | [show references] |