Skip to content

Instantly share code, notes, and snippets.

View mydpy's full-sized avatar

Myles Daniel Baker mydpy

View GitHub Profile
@mydpy
mydpy / gz.scala
Created May 21, 2019 13:43 — forked from pauca/gz.scala
scala read / write from compressed gz
import java.io._
import java.util.zip._
import scala.io.Source
var in = new GZIPInputStream(new FileInputStream("test.gz"))
// write setup in different objects to close later properly (important for big files )
var fos = new FileOutputStream("test2.gz")
var gzos = new GZIPOutputStream( fos )
var w = new PrintWriter(gzos)