Skip to content

Commit 6bc8c17

Browse files
committed
PDFBOX-5660: use try-with-resources
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1934341 13f79535-47bb-0310-9956-ffa450edef68
1 parent 6138393 commit 6bc8c17

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFont.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.apache.pdfbox.cos.COSName;
3232
import org.apache.pdfbox.cos.COSNumber;
3333
import org.apache.pdfbox.cos.COSStream;
34-
import org.apache.pdfbox.io.IOUtils;
3534
import org.apache.pdfbox.pdmodel.common.COSObjectable;
3635
import org.apache.pdfbox.util.Vector;
3736

@@ -425,9 +424,11 @@ final int[] readCIDToGIDMap() throws IOException
425424
COSStream stream = dict.getCOSStream(COSName.CID_TO_GID_MAP);
426425
if (stream != null)
427426
{
428-
InputStream is = stream.createInputStream();
429-
byte[] mapAsBytes = is.readAllBytes();
430-
IOUtils.closeQuietly(is);
427+
byte[] mapAsBytes;
428+
try (InputStream is = stream.createInputStream())
429+
{
430+
mapAsBytes = is.readAllBytes();
431+
}
431432
int numberOfInts = mapAsBytes.length / 2;
432433
cid2gid = new int[numberOfInts];
433434
int offset = 0;

0 commit comments

Comments
 (0)