sclass MultiShortArrayInputStream_resettable extends InputStream {
L<short[]> l;
int idx, iBuf;
int mark_idx, mark_iBuf;
bool bigEndian;
*(L<short[]> *l) {}
public bool markSupported() { true; }
public void mark(int n) {
mark_idx = idx;
mark_iBuf = iBuf;
}
public void reset() {
idx = mark_idx;
iBuf = mark_iBuf;
}
public int read() {
while (iBuf >= l(get(l, idx))*2)
if (idx >= l(l)-1) ret -1;
else { ++idx; iBuf = 0; }
short s = get(l, idx)[iBuf/2];
int i = (odd(iBuf) != bigEndian ? s >> 8 : s) & 0xFF;
iBuf++;
ret i;
}
}Began life as a copy of #1018606
download show line numbers debug dex old transpilations
Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1019269 |
| Snippet name: | MultiShortArrayInputStream_resettable - reads from L<short[]> |
| Eternal ID of this version: | #1019269/4 |
| Text MD5: | 701f5deddf3533ca06644c9bc0aa36ae |
| Author: | stefan |
| Category: | javax / io |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-10-28 18:20:56 |
| Source code size: | 640 bytes / 30 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 815 / 1333 |
| Version history: | 3 change(s) |
| Referenced in: | #1031898 - ShortArrayInputStream - reads from short[] #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674) |