// Path: public-java/io/iamcontent-io-core/src/main/java/com/iamcontent/io/util/IOUtils.java
// public static void appendQuietly(Appendable out, String s) {
// 	try {
// 		out.append(s);
// 	} catch (IOException e) {
// 		throw new IORuntimeException(e);
// 	}
// }
// 
// Path: public-java/io/iamcontent-io-core/src/main/java/com/iamcontent/io/util/IOUtils.java
// public static Stream<String> lineStreamOf(InputStream is) {
// 	final InputStreamReader reader = new InputStreamReader(is);
// 	return new BufferedReader(reader).lines();
// }
// 
// Path: public-java/io/iamcontent-io-core/src/main/java/com/iamcontent/io/IORuntimeException.java
// public class IORuntimeException extends RuntimeException {
// 
// 	public IORuntimeException(String message) {
// 		super(message);
// 	}
// 
// 	public IORuntimeException(Throwable cause) {
// 		super(cause);
// 	}
// 	
// 	private static final long serialVersionUID = 1L;
// }


import static com.iamcontent.io.util.IOUtils.appendQuietly;
import static com.iamcontent.io.util.IOUtils.lineStreamOf;
import java.io.InputStream;
import java.util.stream.Stream;
import com.iamcontent.io.IORuntimeException;

package com.iamcontent.io.util;




/**
 * Utilities for reading resources.
 * @author Greg Elderfield
 */
public class ResourceUtils {

	public static void appendResource(String fileName, Appendable onto) {
		resourceAsLineStream(fileName).forEach(l -> appendQuietly(onto, l));
	}

	public static Stream<String> resourceAsLineStream(String fileName) {
		final InputStream is = ResourceUtils.class.getClassLoader().getResourceAsStream(fileName);
		if (is==null)
			throw new IORuntimeException("Could not find resource: " + fileName);

// Path: public-java/io/iamcontent-io-core/src/main/java/com/iamcontent/io/util/IOUtils.java
// public static void appendQuietly(Appendable out, String s) {
// 	try {
// 		out.append(s);
// 	} catch (IOException e) {
// 		throw new IORuntimeException(e);
// 	}
// }
// 
// Path: public-java/io/iamcontent-io-core/src/main/java/com/iamcontent/io/util/IOUtils.java
// public static Stream<String> lineStreamOf(InputStream is) {
// 	final InputStreamReader reader = new InputStreamReader(is);
// 	return new BufferedReader(reader).lines();
// }
// 
// Path: public-java/io/iamcontent-io-core/src/main/java/com/iamcontent/io/IORuntimeException.java
// public class IORuntimeException extends RuntimeException {
// 
// 	public IORuntimeException(String message) {
// 		super(message);
// 	}
// 
// 	public IORuntimeException(Throwable cause) {
// 		super(cause);
// 	}
// 	
// 	private static final long serialVersionUID = 1L;
// }


// Path: public-java/io/iamcontent-io-core/src/main/java/com/iamcontent/io/util/ResourceUtils.java
import static com.iamcontent.io.util.IOUtils.appendQuietly;
import static com.iamcontent.io.util.IOUtils.lineStreamOf;
import java.io.InputStream;
import java.util.stream.Stream;
import com.iamcontent.io.IORuntimeException;

package com.iamcontent.io.util;




/**
 * Utilities for reading resources.
 * @author Greg Elderfield
 */
public class ResourceUtils {

	public static void appendResource(String fileName, Appendable onto) {
		resourceAsLineStream(fileName).forEach(l -> appendQuietly(onto, l));
	}

	public static Stream<String> resourceAsLineStream(String fileName) {
		final InputStream is = ResourceUtils.class.getClassLoader().getResourceAsStream(fileName);
		if (is==null)
			throw new IORuntimeException("Could not find resource: " + fileName);

		return lineStreamOf(is);
