exense-basic-commons/src/main/java/ch/exense/commons/io/FileHelper.java
/**
	 * Reads a classloader resource and returns its content as byte array
	 * @param classLoader the classloader to access the resource
	 * @param resourceName the name of the resource
	 * @return the content of the resource as byte array
	 * @throws IOException
	 */
Reads a classloader resource and returns its content as byte array
@param classLoader the classloader to access the resource
@param resourceName the name of the resource
@return the content of the resource as byte array
@throws IOException
Reads a classloader resource and returns its content as byte array @param classLoader the classloader to access the resource @param resourceName the name of the resource @return the content of the resource as byte array @throws IOException
public static byte[] readClassLoaderResourceAsByteArray(ClassLoader classLoader, String resourceName) throws IOException {
		try(InputStream resourceAsStream = classLoader.getResourceAsStream(resourceName); ByteArrayOutputStream out = new ByteArrayOutputStream()) {
			copy(resourceAsStream, out);
			return out.toByteArray();
		}
	}
public static byte [ ] readClassLoaderResourceAsByteArray ( ClassLoader classLoader , String resourceName ) throws IOException { try ( InputStream resourceAsStream = classLoader . getResourceAsStream ( resourceName ) ; ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ) { copy ( resourceAsStream , out ) ; return out . toByteArray ( ) ; } }
Reads a classloader resource and returns its content as byte array
 @param classLoader the classloader to access the resource
 @param resourceName the name of the resource
 @return the content of the resource as byte array
 @throws IOException
Reads a classloader resource and returns its content as byte array @param classLoader the classloader to access the resource @param resourceName the name of the resource @return the content of the resource as byte array @throws IOException