import java.io.*; import java.util.*; import java.util.zip.*; ZipInputStream in = null; OutputStream out = null; try { in = new ZipInputStream(inputStream); ZipEntry ze = in.getNextEntry(); int len; byte[] buf = new byte[1024]; out = new BufferedOutputStream(service.getOutputStream()); while ((len = in.read(buf)) > 0) out.write(buf, 0, len); out.flush(); } catch (Exception e) { service.getLogger().error( "Error while decompression : " + e.getMessage(), e); throw e; } finally { try { if (out != null) out.close(); } catch (IOException e) { service.getLogger().error( "Ouput stream can not be closed : " + e.getMessage(), e); throw e; } }