Improve pages cache creation

This commit is contained in:
Koitharu
2022-12-09 18:24:55 +02:00
parent 59fa61864a
commit 1261a6790d
2 changed files with 19 additions and 4 deletions

View File

@@ -23,6 +23,8 @@ fun File.subdir(name: String) = File(this, name).also {
fun File.takeIfReadable() = takeIf { it.exists() && it.canRead() }
fun File.takeIfWriteable() = takeIf { it.exists() && it.canWrite() }
fun ZipFile.readText(entry: ZipEntry) = getInputStream(entry).bufferedReader().use {
it.readText()
}
@@ -74,4 +76,4 @@ private fun computeSizeInternal(file: File): Long {
} else {
return file.length()
}
}
}