io.github.binaryfoo.res.ClasspathIO Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of emv-bertlv Show documentation
Show all versions of emv-bertlv Show documentation
Some decoders for the data used in EMV credit card transactions.
package io.github.binaryfoo.res;
import org.apache.commons.io.IOUtils;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
public class ClasspathIO {
public static List readLines(String fileName) {
try (InputStream in = open(fileName)) {
return IOUtils.readLines(in);
} catch (IOException e) {
throw new RuntimeException("Failed to read " + fileName, e);
}
}
public static InputStream open(String fileName) {
return ClasspathIO.class.getClassLoader().getResourceAsStream(fileName);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy