private void outputFifteenPuzzleData(final String filename, final DataOutputStream dos) {
		System.err.print("Writing file...");
		if (filename == null) {
			// Write values to stdout. User can redirect stdout to a file, if desired.
			for (int i = 0; i < this.configTable_15_puzzle.length; ++i) {
				final long config = this.configTable_15_puzzle[i];
				System.out.println((i + 1) + "," + config + "," + this.costTable_15_puzzle[i] + ","
						+ Utility.longToString(config, this.numOfTiles));
			}
		} else {
			int i = 0;
			try {
				for (; i < this.costTable_15_puzzle.length; ++i) {
					dos.writeByte(this.costTable_15_puzzle[i]);
				}
			} catch (final IOException ioe) {
				System.err.println("Error: Cannot write entry " + i + " to file.");
				System.exit(1);
			} finally {
				try {
					if (dos != null) {
						dos.close();
					}
				} catch (final IOException ioe) {
				}
			}
		}
		System.err.println("done");
	}