sclass MultiShortArrayInputStream extends InputStream { Iterator it; short[] buf; int iBuf; *(Iterable l) { it = iterator(l); } public int read() { while (iBuf >= l(buf)*2) if (!it.hasNext()) ret -1; else { buf = it.next(); iBuf = 0; } short s = buf[iBuf/2]; int i = (odd(iBuf) ? s >> 8 : s) & 0xFF; iBuf++; ret i; } }