Skip to content

Commit

Permalink
Revert "Set Gzip compression level to Deflater.BEST_COMPRESSION (#1…
Browse files Browse the repository at this point in the history
…2691)"

This reverts commit 997648e.
  • Loading branch information
yairm210 committed Dec 22, 2024
1 parent 5320223 commit 053ca67
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions core/src/com/unciv/ui/screens/savescreens/Gzip.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,17 @@ import java.io.BufferedReader
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.InputStreamReader
import java.util.zip.Deflater
import java.util.zip.GZIPInputStream
import java.util.zip.GZIPOutputStream


object Gzip {

fun zip(data: String): String = encode(compress(data))
fun unzip(data: String): String = decompress(decode(data))
fun unzip(data: String): String = decompress(decode(data))

private fun compress(data: String): ByteArray {
val bos = ByteArrayOutputStream(data.length)
val gzip = object : GZIPOutputStream(bos) {
init {
def.setLevel(Deflater.BEST_COMPRESSION)
}
}
val gzip = GZIPOutputStream(bos)
gzip.write(data.toByteArray())
gzip.close()
val compressed = bos.toByteArray()
Expand Down

0 comments on commit 053ca67

Please sign in to comment.