Package htsjdk.samtools.util
Class AsyncBlockCompressedInputStream
java.lang.Object
java.io.InputStream
htsjdk.samtools.util.BlockCompressedInputStream
htsjdk.samtools.util.AsyncBlockCompressedInputStream
- All Implemented Interfaces:
LocationAware
,Closeable
,AutoCloseable
Asynchronous read-ahead implementation of
BlockCompressedInputStream
.
Note that this implementation is not synchronized. If multiple threads access an instance concurrently, it must be synchronized externally.-
Nested Class Summary
Nested classes/interfaces inherited from class htsjdk.samtools.util.BlockCompressedInputStream
BlockCompressedInputStream.DecompressedBlock, BlockCompressedInputStream.FileTermination
-
Field Summary
Fields inherited from class htsjdk.samtools.util.BlockCompressedInputStream
CANNOT_SEEK_CLOSED_STREAM_MSG, CANNOT_SEEK_STREAM_MSG, INCORRECT_HEADER_SIZE_MSG, INVALID_FILE_PTR_MSG, PREMATURE_END_MSG, UNEXPECTED_BLOCK_LENGTH_MSG
-
Constructor Summary
ConstructorsConstructorDescriptionAsyncBlockCompressedInputStream
(SeekableStream strm, InflaterFactory inflaterFactory) AsyncBlockCompressedInputStream
(File file, InflaterFactory inflaterFactory) AsyncBlockCompressedInputStream
(InputStream stream, InflaterFactory inflaterFactory) AsyncBlockCompressedInputStream
(URL url, InflaterFactory inflaterFactory) -
Method Summary
Methods inherited from class htsjdk.samtools.util.BlockCompressedInputStream
assertNonDefectiveFile, assertNonDefectivePath, available, checkTermination, checkTermination, checkTermination, endOfBlock, getFileBlock, getFilePointer, getPosition, isValidFile, processNextBlock, read, read, read, readLine, seek, setCheckCrcs
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
AsyncBlockCompressedInputStream
-
AsyncBlockCompressedInputStream
-
AsyncBlockCompressedInputStream
- Throws:
IOException
-
AsyncBlockCompressedInputStream
public AsyncBlockCompressedInputStream(File file, InflaterFactory inflaterFactory) throws IOException - Throws:
IOException
-
AsyncBlockCompressedInputStream
-
AsyncBlockCompressedInputStream
-
AsyncBlockCompressedInputStream
-
AsyncBlockCompressedInputStream
-
-
Method Details
-
nextBlock
Description copied from class:BlockCompressedInputStream
Reads and decompresses the next block- Overrides:
nextBlock
in classBlockCompressedInputStream
- Parameters:
bufferAvailableForReuse
- decompression buffer available for reuse- Returns:
- next block in the decompressed stream
-
prepareForSeek
protected void prepareForSeek()Description copied from class:BlockCompressedInputStream
Performs cleanup required before seek is called on the underlying stream- Overrides:
prepareForSeek
in classBlockCompressedInputStream
-
close
Description copied from class:BlockCompressedInputStream
Closes the underlying InputStream or RandomAccessFile- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classBlockCompressedInputStream
- Throws:
IOException
-