// Path: src/main/java/org/seqdoop/hadoop_bam/util/WrapSeekable.java
// public class WrapSeekable<S extends InputStream & Seekable>
// 	extends SeekableStream
// {
// 	private final S    stm;
// 	private final long len;
// 	private final Path path;
// 
// 	public WrapSeekable(final S s, long length, Path p) {
// 		stm  = s;
// 		len  = length;
// 		path = p;
// 	}
// 
// 	/** A helper for the common use case. */
// 	public static WrapSeekable<FSDataInputStream> openPath(
// 		FileSystem fs, Path p) throws IOException
// 	{
// 		return new WrapSeekable<FSDataInputStream>(
// 			fs.open(p), fs.getFileStatus(p).getLen(), p);
// 	}
// 	public static WrapSeekable<FSDataInputStream> openPath(
// 		Configuration conf, Path path) throws IOException
// 	{
// 		return openPath(path.getFileSystem(conf), path);
// 	}
// 
// 	@Override public String getSource() { return path.toString(); }
// 	@Override public long   length   () { return len; }
// 
// 	@Override public long position() throws IOException { return stm.getPos(); }
// 	@Override public void    close() throws IOException { stm.close(); }
// 	@Override public boolean eof  () throws IOException {
// 		return stm.getPos() == length();
// 	}
// 	@Override public void seek(long pos) throws IOException {
// 		stm.seek(pos);
// 	}
// 	@Override public int read() throws IOException {
// 		return stm.read();
// 	}
// 	@Override public int read(byte[] buf, int offset, int len)
// 		throws IOException
// 	{
// 		return stm.read(buf, offset, len);
// 	}
// }


import htsjdk.samtools.SAMUtils;
import htsjdk.samtools.seekablestream.SeekableStream;
import java.io.File;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.junit.Test;
import org.seqdoop.hadoop_bam.util.WrapSeekable;
import static org.junit.Assert.assertEquals;
package org.seqdoop.hadoop_bam;



public class TestBAMSplitGuesser {

  @Test
  public void test() throws Exception {
    Configuration conf = new Configuration();
    String bam = getClass().getClassLoader().getResource("test.bam").getFile();
// Path: src/main/java/org/seqdoop/hadoop_bam/util/WrapSeekable.java
// public class WrapSeekable<S extends InputStream & Seekable>
// 	extends SeekableStream
// {
// 	private final S    stm;
// 	private final long len;
// 	private final Path path;
// 
// 	public WrapSeekable(final S s, long length, Path p) {
// 		stm  = s;
// 		len  = length;
// 		path = p;
// 	}
// 
// 	/** A helper for the common use case. */
// 	public static WrapSeekable<FSDataInputStream> openPath(
// 		FileSystem fs, Path p) throws IOException
// 	{
// 		return new WrapSeekable<FSDataInputStream>(
// 			fs.open(p), fs.getFileStatus(p).getLen(), p);
// 	}
// 	public static WrapSeekable<FSDataInputStream> openPath(
// 		Configuration conf, Path path) throws IOException
// 	{
// 		return openPath(path.getFileSystem(conf), path);
// 	}
// 
// 	@Override public String getSource() { return path.toString(); }
// 	@Override public long   length   () { return len; }
// 
// 	@Override public long position() throws IOException { return stm.getPos(); }
// 	@Override public void    close() throws IOException { stm.close(); }
// 	@Override public boolean eof  () throws IOException {
// 		return stm.getPos() == length();
// 	}
// 	@Override public void seek(long pos) throws IOException {
// 		stm.seek(pos);
// 	}
// 	@Override public int read() throws IOException {
// 		return stm.read();
// 	}
// 	@Override public int read(byte[] buf, int offset, int len)
// 		throws IOException
// 	{
// 		return stm.read(buf, offset, len);
// 	}
// }


// Path: src/test/java/org/seqdoop/hadoop_bam/TestBAMSplitGuesser.java
import htsjdk.samtools.SAMUtils;
import htsjdk.samtools.seekablestream.SeekableStream;
import java.io.File;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.junit.Test;
import org.seqdoop.hadoop_bam.util.WrapSeekable;
import static org.junit.Assert.assertEquals;

package org.seqdoop.hadoop_bam;



public class TestBAMSplitGuesser {

  @Test
  public void test() throws Exception {
    Configuration conf = new Configuration();
    String bam = getClass().getClassLoader().getResource("test.bam").getFile();
    SeekableStream ss = WrapSeekable.openPath(conf, new Path(bam));