@Override public void write(final FastqRecord rec) { // encode without creating a String FastqEncoder.write(writer, rec); // and print a new line writer.println(); if (writer.checkError()) { throw new SAMException("Error in writing fastq file " + path); } }
@Override public void write(final FastqRecord rec) { // encode without creating a String FastqEncoder.write(writer, rec); // and print a new line writer.println(); if (writer.checkError()) { throw new SAMException("Error in writing fastq file " + path); } }
/** * Encodes a FastqRecord in the String FASTQ format. */ public static String encode(final FastqRecord record) { // reserve some memory based on the read length int capacity = record.getReadLength() * 2 + 5; // reserve some memory based on the read name if (record.getReadName() != null) { capacity += record.getReadName().length(); } return write(new StringBuilder(capacity), record).toString(); }
/** * Encodes a FastqRecord in the String FASTQ format. */ public static String encode(final FastqRecord record) { // reserve some memory based on the read length int capacity = record.getReadLength() * 2 + 5; // reserve some memory based on the read name if (record.getReadName() != null) { capacity += record.getReadName().length(); } return write(new StringBuilder(capacity), record).toString(); }