Class 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 Detail

      • CompressorCache

        public CompressorCache()
    • 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