private int readValue
			(Res_Value val,
			byte[] remainingData,
			int offset) throws IOException {
		int initialOffset = offset;
		
		val.size = readUInt16(remainingData, offset);
		offset += 2;
		if (val.size > 8)	// This should always be 8. Check to not fail on broken resources in apps
			return 0;
		
		val.res0 = readUInt8(remainingData, offset);
		if (val.res0 != 0)
			throw new RuntimeException("File format error, res0 was not zero");
		offset += 1;

		val.dataType = readUInt8(remainingData, offset);
		offset += 1;

		val.data = readUInt32(remainingData, offset);
		offset += 4;
		
		assert offset == initialOffset + val.size;
		return offset;
	}