public class BlockCompressedInputStream extends java.io.InputStream implements LocationAware
| Modifier and Type | Class and Description |
|---|---|
static class |
BlockCompressedInputStream.FileTermination |
| Constructor and Description |
|---|
BlockCompressedInputStream(java.io.File file)
Use this ctor if you wish to call seek()
|
BlockCompressedInputStream(java.io.InputStream stream)
Note that seek() is not supported if this ctor is used.
|
BlockCompressedInputStream(java.io.InputStream stream,
boolean allowBuffering)
Note that seek() is not supported if this ctor is used.
|
BlockCompressedInputStream(SeekableStream strm)
For providing some arbitrary data source.
|
BlockCompressedInputStream(java.net.URL url) |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertNonDefectiveFile(java.io.File file) |
int |
available() |
static BlockCompressedInputStream.FileTermination |
checkTermination(java.io.File file) |
void |
close()
Closes the underlying InputStream or RandomAccessFile
|
boolean |
endOfBlock() |
static long |
getFileBlock(long bgzfOffset) |
long |
getFilePointer() |
long |
getPosition()
The current offset, in bytes, of this stream/writer/file.
|
static boolean |
isValidFile(java.io.InputStream stream) |
int |
read()
Reads the next byte of data from the input stream.
|
int |
read(byte[] buffer)
Reads some number of bytes from the input stream and stores them into the buffer array b.
|
int |
read(byte[] buffer,
int offset,
int length)
Reads up to len bytes of data from the input stream into an array of bytes.
|
java.lang.String |
readLine()
Reads a whole line.
|
void |
seek(long pos)
Seek to the given position in the file.
|
void |
setCheckCrcs(boolean check)
Determines whether or not the inflater will re-calculated the CRC on the decompressed data
and check it against the value stored in the GZIP header.
|
public BlockCompressedInputStream(java.io.InputStream stream)
public BlockCompressedInputStream(java.io.InputStream stream,
boolean allowBuffering)
public BlockCompressedInputStream(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic BlockCompressedInputStream(java.net.URL url)
public BlockCompressedInputStream(SeekableStream strm)
public void setCheckCrcs(boolean check)
public int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic boolean endOfBlock()
true if the stream is at the end of a BGZF block,
false otherwise.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] buffer)
throws java.io.IOException
read in class java.io.InputStreambuffer - the buffer into which the data is read.java.io.IOExceptionpublic java.lang.String readLine()
throws java.io.IOException
java.io.IOException - If an I/O error occurspublic int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in class java.io.InputStreambuffer - buffer into which data is read.offset - the start offset in array b at which the data is written.length - the maximum number of bytes to read.java.io.IOExceptionpublic void seek(long pos)
throws java.io.IOException
pos - virtual file pointerjava.io.IOExceptionpublic long getFilePointer()
public long getPosition()
LocationAwaregetPosition in interface LocationAwarepublic static long getFileBlock(long bgzfOffset)
public static boolean isValidFile(java.io.InputStream stream)
throws java.io.IOException
stream - Must be at start of file. Throws RuntimeException if !stream.markSupported().java.io.IOExceptionpublic static BlockCompressedInputStream.FileTermination checkTermination(java.io.File file) throws java.io.IOException
java.io.IOExceptionpublic static void assertNonDefectiveFile(java.io.File file)
throws java.io.IOException
java.io.IOException