public void dumpRegion() {

		File result = new File(GeoGonv.OUT_DIR, region.toString() + ".l2j");

		try {
			result.createNewFile();
		} catch (IOException e) {
			e.printStackTrace();
			System.out.println("Can't create file: " + result.getAbsoluteFile());
			return;
		}

		FileOutputStream outputStream;
		try {
			outputStream = new FileOutputStream(result);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		}

		for (Block block : region.getBlocks()) {
			BlockType blockType = Utils.getBlockType(block);
			switch(blockType){
				case FLAT:
					dumpFlat(block, outputStream);
					break;
				case COMPLEX:
					dumpComplex(block, outputStream);
					break;
				case MULTILEVEL:
					dumpMultilevel(block, outputStream);
					break;
			}
		}

		try{
			outputStream.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}