static int read2Byte(List stream){ var bl = []; for(int i = 0; i < 2; i++){ bl.add(nextByte(stream)); } return (bl[0] << 8) | bl[1]; }