private static byte[] loadImage() {
URL url = Thread.currentThread().getContextClassLoader().getResource("photo.png");
try {
return Files.readAllBytes(Paths.get(url.toURI()));
} catch (Exception e) {
throw new RuntimeException("Can not load the image");
}
}
Created
January 11, 2016 15:31
-
-
Save simonwoo/eb5ee5ce70444f0b7fba to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment