internal static short readShort(byte[] buffer, int offset) { short value = (short)(buffer[offset] & 0xFF); value += (short)((buffer[offset + 1] & 0xFF) << 8); return value; }