Package htsjdk.samtools.cram.structure
Class CompressorCache
- java.lang.Object
-
- htsjdk.samtools.cram.structure.CompressorCache
-
public class CompressorCache extends Object
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
Constructors Constructor Description CompressorCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExternalCompressor
getCompressorForMethod(BlockCompressionMethod compressionMethod, int compressorSpecificArg)
Return a compressor if its in our cache, otherwise spin one up and cache it and return it.
-
-
-
Method Detail
-
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
-
-