Package htsjdk.samtools.cram.structure
Class CompressorCache
java.lang.Object
htsjdk.samtools.cram.structure.CompressorCache
Maintain a cache of reusable compressor instances in order to reduce the need to repeatedly
instantiate them, since some, like the RANS de/compressor, allocate large numbers (~256k) of
small temporary objects every time they're instantiated.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCompressorForMethod
(BlockCompressionMethod compressionMethod, int compressorSpecificArg) Return a compressor if its in our cache, otherwise spin one up and cache it and return it.
-
Constructor Details
-
CompressorCache
public CompressorCache()
-
-
Method Details
-
getCompressorForMethod
public ExternalCompressor getCompressorForMethod(BlockCompressionMethod compressionMethod, int compressorSpecificArg) Return a compressor if its in our cache, otherwise spin one up and cache it and return it.- Parameters:
compressionMethod
-compressorSpecificArg
-- Returns:
- a cached compressor instance
-