A sample code of gzip in Scala. API of gzip is included in the package java.util.zip. It provides GZIPOutputStream and GZIPInputStream, the subclasses of DeflatterOutputStream and InflatterInputStream, respectively. GZIPOutputStream compresses data into a given output stream and GZIPInputStream decompresses data from an input one.