Bug #53707: SlideShow.addPicture declares IOException but throws HSLFException

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1402550 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yegor Kozlov 2012-10-26 15:40:53 +00:00
parent 7ba0f8af84
commit 074dd87183

View File

@ -853,13 +853,13 @@ public final class SlideShow {
public int addPicture(File pict, int format) throws IOException {
int length = (int) pict.length();
byte[] data = new byte[length];
try {
FileInputStream is = new FileInputStream(pict);
FileInputStream is = null;
try {
is = new FileInputStream(pict);
is.read(data);
is.close();
} catch (IOException e) {
throw new HSLFException(e);
}
} finally {
if(is != null) is.close();
}
return addPicture(data, format);
}