Code example for GZIPOutputStream

Methods: finish

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