added cli tool

This commit is contained in:
2020-04-27 19:41:06 +01:00
parent 0479cf0560
commit 9f48d6ee3a
9 changed files with 256 additions and 11 deletions

View File

@@ -0,0 +1,22 @@
import net.woggioni.jzstd.ZstdOutputStream
import org.junit.jupiter.api.Test
import java.nio.file.Files
import java.nio.file.Paths
class InsaneTest {
@Test
fun test2() {
val inputFile = Paths.get("/tmp/Richard_Dawkins_The_Selfish_Gene.pdf")
Files.newInputStream(inputFile).use { `is` ->
ZstdOutputStream.from(Files.newOutputStream(Paths.get("/tmp/Richard_Dawkins_The_Selfish_Gene.pdf.zst"))).use { os ->
val buffer = ByteArray(0x10000)
while (true) {
val read = `is`.read(buffer)
if (read < 0) break
os.write(buffer, 0, read)
}
}
}
}
}