All Downloads are FREE. Search and download functionalities are using the official Maven repository.

se.l4.commons.io.IoConsumer Maven / Gradle / Ivy

The newest version!
package se.l4.commons.io;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.function.Consumer;

public interface IoConsumer
{
	void accept(T item)
		throws IOException;

	static  Consumer adapt(IoConsumer consumer)
	{
		return item -> {
			try
			{
				consumer.accept(item);
			}
			catch(IOException e)
			{
				throw new UncheckedIOException("IOException while running; " + e.getMessage(), e);
			}
		};
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy