Libraryless. Click here for Pure Java version (3793L/22K).
1 | sbool getBit(byte[] b, int bit) { |
2 | int idx = bit >> 3; |
3 | if (idx < 0 || idx > l(b)) false; |
4 | byte mask = cast 1 << (bit & 7); |
5 | ret (b[idx] & mask) != 0; |
6 | } |
Began life as a copy of #1014003
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1014004 |
Snippet name: | getBit |
Eternal ID of this version: | #1014004/4 |
Text MD5: | 7f1883cebc6c24e75027fddbb60c12ef |
Transpilation MD5: | 1a1d660fd2575db1ab7ade84ce033618 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-09-23 09:02:38 |
Source code size: | 161 bytes / 6 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 476 / 498 |
Version history: | 3 change(s) |
Referenced in: | [show references] |