src/Pure/General/xz.scala
changeset 64002 08f89f0e8a62
parent 64000 445b3deced8f
child 64004 b4ece7a3f2ca
--- a/src/Pure/General/xz.scala	Mon Oct 03 10:49:27 2016 +0200
+++ b/src/Pure/General/xz.scala	Mon Oct 03 10:51:51 2016 +0200
@@ -1,32 +1,25 @@
 /*  Title:      Pure/General/xz.scala
     Author:     Makarius
 
-XZ data compression.
+Support for XZ data compression.
 */
 
 package isabelle
 
 
-import java.io.{File => JFile, BufferedOutputStream, OutputStream, InputStream, BufferedInputStream}
-
-import org.tukaani.xz.{LZMA2Options, XZInputStream, XZOutputStream}
+import org.tukaani.xz.LZMA2Options
 
 
 object XZ
 {
-  def options(preset: Int): LZMA2Options =
+  type Options = LZMA2Options
+
+  def options(): Options = options_preset(3)
+
+  def options_preset(preset: Int): Options =
   {
     val opts = new LZMA2Options
     opts.setPreset(preset)
     opts
   }
-
-  def write_file(file: JFile, text: Iterable[CharSequence], preset: Int = 3)
-  {
-    val opts = options(preset)
-    File.write_file(file, text,
-      (s: OutputStream) => new XZOutputStream(new BufferedOutputStream(s), opts))
-  }
-
-  def uncompress(s: InputStream): XZInputStream = new XZInputStream(new BufferedInputStream(s))
 }