code: private static String compress(String str) throws EncoderException {
  	ByteArrayOutputStream rstBao = null;
  	GZIPOutputStream zos = null;
      try {
      	rstBao = new ByteArrayOutputStream();
      	zos = new GZIPOutputStream(rstBao);
      	zos.write(str.getBytes());
      	IOUtils.closeQuietly(zos);
  	    
      	byte[] bytes = rstBao.toByteArray();
      	return Base64.encodeBase64String(bytes);
      } catch(Exception e){
      	throw new EncoderException("Molfile could not be compressed. " + str);
     } finally{
  	   IOUtils.closeQuietly(zos);
     }
  	  
    }
docs: method to compress the given molfile in a gezipped Base64 string
  
  @param str given molfile
  @throws EncoderException