Package htsjdk.samtools.seekablestream
Class SeekableFTPStream
- java.lang.Object
-
- java.io.InputStream
-
- htsjdk.samtools.seekablestream.SeekableStream
-
- htsjdk.samtools.seekablestream.SeekableFTPStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class SeekableFTPStream extends SeekableStream
Unfortunately the seekable stream classes exist for both Tribble and Picard, and we need both. This class is for use with Tribble and delegates all the work to a helper.
-
-
Field Summary
-
Fields inherited from class htsjdk.samtools.seekablestream.SeekableStream
mark
-
-
Constructor Summary
Constructors Constructor Description SeekableFTPStream(URL url)SeekableFTPStream(URL url, UserPasswordInput userPasswordInput)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleaneof()StringgetSource()longlength()static voidmain(String[] args)longposition()intread()intread(byte[] buffer, int offset, int len)voidseek(long position)Seeks the stream to the provided position.longskip(long n)-
Methods inherited from class htsjdk.samtools.seekablestream.SeekableStream
available, mark, markSupported, readFully, reset
-
Methods inherited from class java.io.InputStream
nullInputStream, read, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
SeekableFTPStream
public SeekableFTPStream(URL url) throws IOException
- Throws:
IOException
-
SeekableFTPStream
public SeekableFTPStream(URL url, UserPasswordInput userPasswordInput) throws IOException
- Throws:
IOException
-
-
Method Detail
-
seek
public void seek(long position)
Description copied from class:SeekableStreamSeeks the stream to the provided position.- Specified by:
seekin classSeekableStream
-
position
public long position()
- Specified by:
positionin classSeekableStream- Returns:
- the current byte position of the stream.
-
eof
public boolean eof() throws IOException- Specified by:
eofin classSeekableStream- Returns:
trueif the stream is already consumed;falseotherwise.- Throws:
IOException
-
getSource
public String getSource()
- Specified by:
getSourcein classSeekableStream- Returns:
- String representation of source (e.g. URL, file path, etc.), or null if not available.
-
length
public long length()
- Specified by:
lengthin classSeekableStream- Returns:
- the length of the stream; 0 if not available or empty.
-
skip
public long skip(long n) throws IOException- Overrides:
skipin classInputStream- Throws:
IOException
-
read
public int read(byte[] buffer, int offset, int len) throws IOException- Specified by:
readin classSeekableStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classSeekableStream- Throws:
IOException
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
main
public static void main(String[] args) throws IOException
- Throws:
IOException
-
-