public byte [ ] toGzipByteArray ( ) { String sitemap = this . toString ( ) ; ByteArrayInputStream inputStream = new ByteArrayInputStream ( sitemap . getBytes ( StandardCharsets . UTF_8 ) ) ; ByteArrayOutputStream outputStream = gzipIt ( inputStream ) ; return outputStream . toByteArray ( ) ; }
Construct sitemap into gzipped file