Code example for GZIPOutputStream

Methods: finish

0
        super(delegate);
    } 
 
    public void serialize(Object instance, OutputStream out) throws IOException {
        if (isGzipEnabled()) { 
            GZIPOutputStream gzip = new GZIPOutputStream(out);
            delegate.serialize(instance, gzip);
            gzip.finish();
        } else { 
            delegate.serialize(instance, out);
        } 
    } 
 
    public <T> T deserialize(InputStream stream, Class<T> clazz) throws IOException {
        if (isGzipEnabled()) 
            stream = new GZIPInputStream(stream);
 
        return delegate.deserialize(stream, clazz);
    } 
}