// init buffer
StringBuilder referenceBuffer = new StringBuilder();
numberOfReferenceContigs = 0;
Fasta contig;
while((contig=reader.read())!=null){
referenceBuffer.append(contig.getSeq().toUpperCase());
numberOfReferenceContigs++;
}
reader.close();
reference = referenceBuffer.toString().getBytes();