FileDocCategorySizeDatePackage
CloseableDisposerRecord.javaAPI DocJava SE 6 API955Tue Jun 10 00:21:54 BST 2008com.sun.imageio.stream

CloseableDisposerRecord

public class CloseableDisposerRecord extends Object implements DisposerRecord
Convenience class that closes a given resource (e.g. RandomAccessFile), typically associated with an Image{Input,Output}Stream, prior to the stream being garbage collected.

Fields Summary
private Closeable
closeable
Constructors Summary
public CloseableDisposerRecord(Closeable closeable)

        this.closeable = closeable;
    
Methods Summary
public synchronized voiddispose()

        if (closeable != null) {
            try {
                closeable.close();
            } catch (IOException e) {
            } finally {
                closeable = null;
            }
        }