short readShortLittleEndian( ) { // clever version // get 2 bytes pieces // unsigned 0..255 int low = readByte() & 0xff; // signed -128 .. 127 int high = readByte(); // avoid masking here, signed result return(short)( high << 8 | low ); }