Warning: session_start(): open(/var/lib/php/sessions/sess_euq1namf6lces0rq6qn0c78e0k, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51

Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
MultiShortArrayInputStream - reads from L<short[]> [1018606]

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

17
LINES

< > BotCompany Repo | #1018606 // MultiShortArrayInputStream - reads from L<short[]>

JavaX fragment (include)

1  
sclass MultiShortArrayInputStream extends InputStream {
2  
  Iterator<short[]> it;
3  
  short[] buf;
4  
  int iBuf;
5  
  
6  
  *(Iterable<short[]> l) { it = iterator(l); }
7  
  
8  
  public int read() {
9  
    while (iBuf >= l(buf)*2)
10  
      if (!it.hasNext()) ret -1;
11  
      else { buf = it.next(); iBuf = 0; }
12  
    short s = buf[iBuf/2];
13  
    int i = (odd(iBuf) ? s >> 8 : s) & 0xFF;
14  
    iBuf++;
15  
    ret i;
16  
  }
17  
}

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: #1018606
Snippet name: MultiShortArrayInputStream - reads from L<short[]>
Eternal ID of this version: #1018606/3
Text MD5: c6f81b59ea0b4f2037e5808c2f2842e5
Author: stefan
Category: javax / io
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-07 16:22:03
Source code size: 402 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 773 / 1312
Version history: 2 change(s)
Referenced in: [show references]