This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired from https://gist.github.com/xis19/41999145269e4aa398aa354e129e507c | |
// Use externally with GzipUtils.compress(yourInputStream) | |
@Component | |
object GzipUtils { | |
private const val BUFFER_SIZE_BYTES = 512 * 1024 | |
private val gzipExecutor = Executors.newCachedThreadPool(CustomizableThreadFactory("gzip-thread-")) | |
@Volatile | |
private var isShuttingDown = false |