private void parse(byte[] compressedData) throws IncorrectFileVersion, EOFException {

		String name;
		int cid;
		ChunkID chunkName;
		
		SaveGameReader compressedBuffer = new SaveGameReader(compressedData);
		SaveGameReader saveData;

		CompressionType ct = CompressionType.valueOf(compressedBuffer.readString(4));
		
		this.sgv = new SaveGameVersion(compressedBuffer.readUint32());
		
		System.out.println("version: "+sgv);
		
		if (!sgv.canReadFile()) {
			throw new IncorrectFileVersion();
		}
		
		switch (ct) {

		case OTTZ:
			saveData = new SaveGameReader(Compression.inflateZLIB(compressedBuffer.getRemainingBytes()));
			break;

		default:
			saveData = new SaveGameReader(compressedBuffer.getRemainingBytes());
			break;

		}

		while (saveData.hasMoreData()) {
			name = saveData.readString(4);
			cid = saveData.readUint8();
			
			try {
				chunkName = ChunkID.valueOf(name);
			} catch (IllegalArgumentException e) {
				System.out.println("cant read name: " + name);
				return;
			}
			
			System.out.println("processing "+name+" as "+ChunkType.valueOf(cid));

			switch (ChunkType.valueOf(cid)) {

			case CH_ARRAY:
				saveData.readChunkArray();
				break;

			case CH_SPARSE_ARRAY:
				saveData.readChunkSparseArray();
				break;
				
			case CH_RIFF:
				procChunk(chunkName, saveData.readRiffData(cid));

			default:
				break;
				
			}
		}
	}