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`

public class AsyncBlockCompressedInputStream extends BlockCompressedInputStream
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

Constructors
Constructor
Description
`AsyncBlockCompressedInputStream(SeekableStream strm)`
`AsyncBlockCompressedInputStream(SeekableStream strm, InflaterFactory inflaterFactory)`
`AsyncBlockCompressedInputStream(File file)`
`AsyncBlockCompressedInputStream(File file, InflaterFactory inflaterFactory)`
`AsyncBlockCompressedInputStream(InputStream stream)`
`AsyncBlockCompressedInputStream(InputStream stream, InflaterFactory inflaterFactory)`
`AsyncBlockCompressedInputStream(URL url)`
`AsyncBlockCompressedInputStream(URL url, InflaterFactory inflaterFactory)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Closes the underlying InputStream or RandomAccessFile
`protected BlockCompressedInputStream.DecompressedBlock`
`nextBlock(byte[] bufferAvailableForReuse)`
Reads and decompresses the next block
`protected void`
`prepareForSeek()`
Performs cleanup required before seek is called on the underlying stream

### 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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### AsyncBlockCompressedInputStream

public AsyncBlockCompressedInputStream(InputStream stream)

### AsyncBlockCompressedInputStream

public AsyncBlockCompressedInputStream(InputStream stream, InflaterFactory inflaterFactory)

### AsyncBlockCompressedInputStream

public AsyncBlockCompressedInputStream(File file) throws IOException

Throws:
  `IOException`

### AsyncBlockCompressedInputStream

public AsyncBlockCompressedInputStream(File file, InflaterFactory inflaterFactory) throws IOException

Throws:
  `IOException`

### AsyncBlockCompressedInputStream

public AsyncBlockCompressedInputStream(URL url)

### AsyncBlockCompressedInputStream

public AsyncBlockCompressedInputStream(URL url, InflaterFactory inflaterFactory)

### AsyncBlockCompressedInputStream

public AsyncBlockCompressedInputStream(SeekableStream strm)

### AsyncBlockCompressedInputStream

public AsyncBlockCompressedInputStream(SeekableStream strm, InflaterFactory inflaterFactory)

## Method Details

### nextBlock

protected BlockCompressedInputStream.DecompressedBlock nextBlock(byte[] bufferAvailableForReuse)
Description copied from class: `BlockCompressedInputStream`
Reads and decompresses the next block

Overrides:
  `nextBlock` in class `BlockCompressedInputStream`
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 class `BlockCompressedInputStream`

### close

public void close() throws IOException
Description copied from class: `BlockCompressedInputStream`
Closes the underlying InputStream or RandomAccessFile

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Overrides:
  `close` in class `BlockCompressedInputStream`
Throws:
  `IOException`