sclass IntArrayInputStream_littleEndian extends InputStream { int[] buf; int to; int iBuf, j; *(int[] *buf) { to = l(buf); } *(int[] *buf, int from, int to) { n = l(buf); iBuf = from; to = n; } public int read() { if (iBuf >= to) ret -1; int x = buf[iBuf]; int out = (x >>> (j*8)) & 0xFF; if (++j >= 4) { ++iBuf; j = 0; } ret out; } }