List of usage examples for java.util.zip GZIPOutputStream finish
public void finish() throws IOException
From source file:hudson.plugins.project_inheritance.projects.InheritanceProject.java
/** * This method dumps the version store as serialized, * GZIP compressed, Base64 encoded XML.//from w w w. j a va 2 s. c om * @return */ public String doGetVersionsAsCompressedXML() { if (this.versionStore == null) { return ""; } String xml = this.versionStore.toXML(); try { ByteArrayOutputStream baos = new ByteArrayOutputStream(512); BASE64EncoderStream b64s = new BASE64EncoderStream(baos); GZIPOutputStream gos = new GZIPOutputStream(b64s); gos.write(xml.getBytes()); gos.finish(); gos.close(); return baos.toString(); } catch (IOException ex) { return ""; } }