Package java.util.zip

Examples of java.util.zip.GZIPOutputStream.finish()


            transformer.transform(featureResults, output);

            //we need to "finish" here because if not,it is possible that the gzipped
            //content do not gets completely written
            if (gzipOut != null) {
                gzipOut.finish();
                gzipOut.flush();
            }
        } catch (TransformerException gmlException) {
            String msg = " error:" + gmlException.getMessage();
            throw new ServiceException(msg, gmlException);
View Full Code Here


            final ParameterValueGroup params = writer.getFormat().getWriteParameters();
            //params.parameter("Compressed").setValue(compressOutput);
            writer.write(sourceCoverage, null);

            if (gzipOut != null) {
                gzipOut.finish();
                gzipOut.flush();
            }

            // freeing everything
            writer.dispose();
View Full Code Here

        if (isGzip(contentEncoding)) {
            ByteArrayOutputStream os = new ByteArrayOutputStream();
            GZIPOutputStream gzip = new GZIPOutputStream(os);
            try {
                IOHelper.copy(in, gzip);
                gzip.finish();
                return new ByteArrayInputStream(os.toByteArray());
            } finally {
                IOHelper.close(gzip, "gzip");
                IOHelper.close(os, "byte array output stream");
            }
View Full Code Here

            GZIPOutputStream gzip = null;
            try {
                os = new ByteArrayOutputStream();
                gzip = new GZIPOutputStream(os);
                gzip.write(data);
                gzip.finish();
                return new ByteArrayInputStream(os.toByteArray());
            } finally {
                IOHelper.close(gzip, "gzip");
                IOHelper.close(os, "byte array output stream");
            }
View Full Code Here

    public static byte[] compressGZIP(byte[] data) throws IOException {
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        GZIPOutputStream gzip = new GZIPOutputStream(os);
        try {
            gzip.write(data);
            gzip.finish();
            return os.toByteArray();
        } finally {
            IOHelper.close(gzip, "gzip");
            IOHelper.close(os, "byte array output stream");
        }
View Full Code Here

        if (isGzip(contentEncoding)) {
            ByteArrayOutputStream os = new ByteArrayOutputStream();
            GZIPOutputStream gzip = new GZIPOutputStream(os);
            try {
                IOHelper.copy(in, gzip);
                gzip.finish();
                return new ByteArrayInputStream(os.toByteArray());
            } finally {
                IOHelper.close(gzip, "gzip");
                IOHelper.close(os, "byte array output stream");
            }
View Full Code Here

            GZIPOutputStream gzip = null;
            try {
                os = new ByteArrayOutputStream();
                gzip = new GZIPOutputStream(os);
                gzip.write(data);
                gzip.finish();
                return new ByteArrayInputStream(os.toByteArray());
            } finally {
                IOHelper.close(gzip, "gzip");
                IOHelper.close(os, "byte array output stream");
            }
View Full Code Here

    public static byte[] compressGZIP(byte[] data) throws IOException {
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        GZIPOutputStream gzip = new GZIPOutputStream(os);
        try {
            gzip.write(data);
            gzip.finish();
            return os.toByteArray();
        } finally {
            IOHelper.close(gzip, "gzip");
            IOHelper.close(os, "byte array");
        }
View Full Code Here

            if (staticFile.isGzipEnabled()) {
                GZIPOutputStream gzip = new GZIPOutputStream(os);
                try {
                    IOUtils.copyAndCloseInput(staticFile.getUrl().openStream(), gzip);
                } finally {
                    gzip.finish();
                }
            } else {
                IOUtils.copyAndCloseInput(staticFile.getUrl().openStream(), os);
            }
        }
View Full Code Here

            if (staticFile.isGzipEnabled()) {
                GZIPOutputStream gzip = new GZIPOutputStream(os);
                try {
                    IOUtils.copyAndCloseInput(staticFile.getUrl().openStream(), gzip);
                } finally {
                    gzip.finish();
                }
            } else {
                IOUtils.copyAndCloseInput(staticFile.getUrl().openStream(), os);
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.