Behandeln eines null in Resource.load()

master^2
Harald Wolff 2017-09-01 20:14:14 +02:00
parent b5d9b6eed2
commit eeadb035f9
1 changed files with 3 additions and 0 deletions

View File

@ -31,6 +31,9 @@ public class Ressource {
}
public static byte[] load(InputStream in) throws IOException{
if (in == null){
return null;
}
byte[] buffer = new byte[in.available()];
in.read(buffer);
return buffer;