Skip to content

Commit 1bfb868

Browse files
committed
PDFBOX-5660: Sonar fix
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1932625 13f79535-47bb-0310-9956-ffa450edef68
1 parent f965b75 commit 1bfb868

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane

debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/Type0Font.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.apache.pdfbox.cos.COSDictionary;
2020
import org.apache.pdfbox.cos.COSName;
2121
import org.apache.pdfbox.cos.COSStream;
22-
import org.apache.pdfbox.io.IOUtils;
2322
import org.apache.pdfbox.pdmodel.font.PDCIDFont;
2423
import org.apache.pdfbox.pdmodel.font.PDFont;
2524
import org.apache.pdfbox.pdmodel.font.PDType0Font;
@@ -114,9 +113,11 @@ private Object[][] readCIDToGIDMap(PDCIDFont font, PDFont parentFont) throws IOE
114113
COSStream stream = dict.getCOSStream(COSName.CID_TO_GID_MAP);
115114
if (stream != null)
116115
{
117-
InputStream is = stream.createInputStream();
118-
byte[] mapAsBytes = is.readAllBytes();
119-
IOUtils.closeQuietly(is);
116+
byte[] mapAsBytes;
117+
try (InputStream is = stream.createInputStream())
118+
{
119+
mapAsBytes = is.readAllBytes();
120+
}
120121
int numberOfInts = mapAsBytes.length / 2;
121122
cid2gid = new Object[numberOfInts][4];
122123
int offset = 0;

0 commit comments

Comments
 (0)