// Path: src/main/java/org/seqdoop/hadoop_bam/FormatConstants.java
// public enum BaseQualityEncoding { Illumina, Sanger };
// 
// Path: src/main/java/org/seqdoop/hadoop_bam/util/ConfHelper.java
// public class ConfHelper
// {
// 	/**
// 	 * Convert a string to a boolean.
// 	 *
// 	 * Accepted values: "yes", "true", "t", "y", "1"
// 	 *                  "no", "false", "f", "n", "0" 
// 	 * All comparisons are case insensitive.
// 	 *
// 	 * If the value provided is null, defaultValue is returned.
// 	 *
// 	 * @exception IllegalArgumentException Thrown if value is not
// 	 * null and doesn't match any of the accepted strings.
// 	 */
// 	public static boolean parseBoolean(String value, boolean defaultValue)
// 	{
// 		if (value == null)
// 			return defaultValue;
// 
// 		value = value.trim();
// 
// 		// any of the following will 
// 		final String[] acceptedTrue = new String[]{ "yes", "true", "t", "y", "1" };
// 		final String[] acceptedFalse = new String[]{ "no", "false", "f", "n", "0" };
// 
// 		for (String possible: acceptedTrue)
// 		{
// 			if (possible.equalsIgnoreCase(value))
// 				return true;
// 		}
// 		for (String possible: acceptedFalse)
// 		{
// 			if (possible.equalsIgnoreCase(value))
// 				return false;
// 		}
// 
// 		throw new IllegalArgumentException("Unrecognized boolean value '" + value + "'");
// 	}
// 
// 	public static boolean parseBoolean(Configuration conf, String propertyName, boolean defaultValue)
// 	{
// 		return parseBoolean(conf.get(propertyName), defaultValue);
// 	}
// }


import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.compress.CompressionCodec;
import org.apache.hadoop.io.compress.CompressionCodecFactory;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.JobContext;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;
import org.seqdoop.hadoop_bam.FormatConstants.BaseQualityEncoding;
import org.seqdoop.hadoop_bam.util.ConfHelper;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.CharacterCodingException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
			else
				return Math.min(1.0f, (pos - start) / (float)(end - start));
		}

		public String makePositionMessage(long pos)
		{
			return file.toString() + ":" + pos;
		}

		public String makePositionMessage()
		{
			return file.toString() + ":" + pos;
		}

		/*
		 * Read a single record.
		 *
		 * Reads a single line of input and scans it with scanQseqLine, which
		 * sets key and value accordingly.  The method updates this.pos.
		 *
		 * @return The number of bytes read.  If no bytes were read, the EOF was reached.
		 */
		private int lowLevelQseqRead(Text key, SequencedFragment value) throws IOException
		{
			int bytesRead = lineReader.readLine(buffer, MAX_LINE_LENGTH);
			pos += bytesRead;
			if (bytesRead >= MAX_LINE_LENGTH)
			{
				String line;
				try {
// Path: src/main/java/org/seqdoop/hadoop_bam/FormatConstants.java
// public enum BaseQualityEncoding { Illumina, Sanger };
// 
// Path: src/main/java/org/seqdoop/hadoop_bam/util/ConfHelper.java
// public class ConfHelper
// {
// 	/**
// 	 * Convert a string to a boolean.
// 	 *
// 	 * Accepted values: "yes", "true", "t", "y", "1"
// 	 *                  "no", "false", "f", "n", "0" 
// 	 * All comparisons are case insensitive.
// 	 *
// 	 * If the value provided is null, defaultValue is returned.
// 	 *
// 	 * @exception IllegalArgumentException Thrown if value is not
// 	 * null and doesn't match any of the accepted strings.
// 	 */
// 	public static boolean parseBoolean(String value, boolean defaultValue)
// 	{
// 		if (value == null)
// 			return defaultValue;
// 
// 		value = value.trim();
// 
// 		// any of the following will 
// 		final String[] acceptedTrue = new String[]{ "yes", "true", "t", "y", "1" };
// 		final String[] acceptedFalse = new String[]{ "no", "false", "f", "n", "0" };
// 
// 		for (String possible: acceptedTrue)
// 		{
// 			if (possible.equalsIgnoreCase(value))
// 				return true;
// 		}
// 		for (String possible: acceptedFalse)
// 		{
// 			if (possible.equalsIgnoreCase(value))
// 				return false;
// 		}
// 
// 		throw new IllegalArgumentException("Unrecognized boolean value '" + value + "'");
// 	}
// 
// 	public static boolean parseBoolean(Configuration conf, String propertyName, boolean defaultValue)
// 	{
// 		return parseBoolean(conf.get(propertyName), defaultValue);
// 	}
// }


// Path: src/main/java/org/seqdoop/hadoop_bam/QseqInputFormat.java
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.compress.CompressionCodec;
import org.apache.hadoop.io.compress.CompressionCodecFactory;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.JobContext;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;
import org.seqdoop.hadoop_bam.FormatConstants.BaseQualityEncoding;
import org.seqdoop.hadoop_bam.util.ConfHelper;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.CharacterCodingException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

			else
				return Math.min(1.0f, (pos - start) / (float)(end - start));
		}

		public String makePositionMessage(long pos)
		{
			return file.toString() + ":" + pos;
		}

		public String makePositionMessage()
		{
			return file.toString() + ":" + pos;
		}

		/*
		 * Read a single record.
		 *
		 * Reads a single line of input and scans it with scanQseqLine, which
		 * sets key and value accordingly.  The method updates this.pos.
		 *
		 * @return The number of bytes read.  If no bytes were read, the EOF was reached.
		 */
		private int lowLevelQseqRead(Text key, SequencedFragment value) throws IOException
		{
			int bytesRead = lineReader.readLine(buffer, MAX_LINE_LENGTH);
			pos += bytesRead;
			if (bytesRead >= MAX_LINE_LENGTH)
			{
				String line;
				try {
					line = Text.decode(buffer.getBytes(), 0, 500);