Slowly start to adjust places in tests where we do not properly close file handles

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1637474 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2014-11-07 22:33:35 +00:00
parent b6a3184196
commit 62ac7efea6
1 changed files with 5 additions and 2 deletions

View File

@ -44,7 +44,10 @@ public class XWPFTestDataSamples {
public static byte[] getImage(String filename) throws IOException {
InputStream is = POIDataSamples.getDocumentInstance().openResourceAsStream(filename);
byte[] result = IOUtils.toByteArray(is);
return result;
try {
return IOUtils.toByteArray(is);
} finally {
is.close();
}
}
}