Skip to content

Instantly share code, notes, and snippets.

View bijancn's full-sized avatar
🚢
Shipping

Bijan Chokoufe Nejad bijancn

🚢
Shipping
View GitHub Profile
@bijancn
bijancn / Gzip.scala
Created November 13, 2018 13:28 — forked from owainlewis/Gzip.scala
Gzip Scala
import java.io.{ByteArrayOutputStream, ByteArrayInputStream}
import java.util.zip.{GZIPOutputStream, GZIPInputStream}
import scala.util.Try
object Gzip {
def compress(input: Array[Byte]): Array[Byte] = {
val bos = new ByteArrayOutputStream(input.length)
val gzip = new GZIPOutputStream(bos)