public synchronized void end() { if (end) return; if (compress) { try { dos.finish(); } catch (Exception e) { } } else { inflater.end(); } end = true; }