1 7 8 package com.sun.imageio.stream; 9 10 import java.io.IOException ; 11 import javax.imageio.stream.ImageInputStream ; 12 13 38 public class StreamFinalizer { 39 private ImageInputStream stream; 40 41 public StreamFinalizer(ImageInputStream stream) { 42 this.stream = stream; 43 } 44 45 protected void finalize() throws Throwable { 46 try { 47 stream.close(); 48 } catch (IOException e) { 49 } finally { 50 stream = null; 51 super.finalize(); 52 } 53 } 54 } 55 | Popular Tags |