org.xnio.Closer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xnio-api Show documentation
Show all versions of xnio-api Show documentation
The API JAR of the XNIO project
package org.xnio;
import java.io.Closeable;
/**
* A {@code Runnable} that closes some resource.
*
* @apiviz.exclude
*/
public final class Closer implements Runnable {
private final Closeable resource;
public Closer(final Closeable resource) {
this.resource = resource;
}
public void run() {
IoUtils.safeClose(resource);
}
}