public Dumper(InputStream cramIS, ReferenceSource referenceSource, int nofStreams, String fastqBaseName,
				boolean gzip, long maxRecords, boolean reverse, int defaultQS, AtomicBoolean brokenPipe)
				throws IOException {

			this.cramIS = cramIS;
			this.referenceSource = referenceSource;
			this.maxRecords = maxRecords;
			this.reverse = reverse;
			this.brokenPipe = brokenPipe;
			outputs = new FileOutput[nofStreams];
			for (int index = 0; index < outputs.length; index++)
				outputs[index] = new FileOutput();

			if (fastqBaseName == null) {
				OutputStream joinedOS = System.out;
				if (gzip)
					joinedOS = (new GZIPOutputStream(joinedOS));
				for (int index = 0; index < outputs.length; index++)
					outputs[index].outputStream = joinedOS;
			} else {
				String extension = ".fastq" + (gzip ? ".gz" : "");
				String path;
				for (int index = 0; index < outputs.length; index++) {
					if (index == 0)
						path = fastqBaseName + extension;
					else
						path = fastqBaseName + "_" + index + extension;

					outputs[index].file = new File(path);
					OutputStream os = new BufferedOutputStream(new FileOutputStream(outputs[index].file));

					if (gzip)
						os = new GZIPOutputStream(os);

					outputs[index].outputStream = os;
				}
			}
		}