* @throws IOException
* in case of IO error
*/
- static public BufferedImage toImage(InputStream in) throws IOException {
+ public static BufferedImage toImage(InputStream in) throws IOException {
MarkableFileInputStream tmpIn = null;
File tmp = null;
try {
return image;
}
+ /**
+ * Open the given /-separated resource (from the binary root).
+ *
+ * @param name
+ * the resource name
+ *
+ * @return the opened resource if found, NLL if not
+ */
+ public static InputStream openResource(String name) {
+ ClassLoader loader = IOUtils.class.getClassLoader();
+ if (loader == null) {
+ loader = ClassLoader.getSystemClassLoader();
+ }
+
+ return loader.getResourceAsStream(name);
+ }
+
/**
* Return the EXIF transformation flag of this image if any.
*
* @throws IOException
* in case of IO error
*/
- static private int getExifTransorm(InputStream in) throws IOException {
+ private static int getExifTransorm(InputStream in) throws IOException {
int[] exif_data = new int[100];
int set_flag = 0;
int is_motorola = 0;