I am using this method to compress my JSON response :
def compressString(content: String): Array[Byte] = { val bos = new ByteArrayOutputStream() val gzs = n