mirror of https://github.com/apache/poi.git
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:
parent
dd840c39d8
commit
5f50592706
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue