scope sqrUbyte static final short[] #table = makeTable(); static int sqrUbyte(int ubyte) { if ((ubyte & ~0xFF) != 0) fail("bad ubyte: " + ubyte); ret unsignedShortToInt(#table[ubyte]); } static short[] #makeTable() { short[] tbl = new[256]; for i to 256: tbl[i] = (short) (i*i); ret tbl; }