Author: tilman
Date: Sat Mar 28 12:45:59 2026
New Revision: 1932624
Log:
PDFBOX-5660: Sonar fix
Modified:
pdfbox/branches/3.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/Type0Font.java
Modified:
pdfbox/branches/3.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/Type0Font.java
==============================================================================
---
pdfbox/branches/3.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/Type0Font.java
Sat Mar 28 12:45:07 2026 (r1932623)
+++
pdfbox/branches/3.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/Type0Font.java
Sat Mar 28 12:45:59 2026 (r1932624)
@@ -19,7 +19,6 @@ package org.apache.pdfbox.debugger.fonte
import org.apache.pdfbox.cos.COSDictionary;
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.cos.COSStream;
-import org.apache.pdfbox.io.IOUtils;
import org.apache.pdfbox.pdmodel.font.PDCIDFont;
import org.apache.pdfbox.pdmodel.font.PDFont;
import org.apache.pdfbox.pdmodel.font.PDType0Font;
@@ -114,9 +113,11 @@ class Type0Font extends FontPane
COSStream stream = dict.getCOSStream(COSName.CID_TO_GID_MAP);
if (stream != null)
{
- InputStream is = stream.createInputStream();
- byte[] mapAsBytes = IOUtils.toByteArray(is);
- IOUtils.closeQuietly(is);
+ byte[] mapAsBytes;
+ try (InputStream is = stream.createInputStream())
+ {
+ mapAsBytes = is.readAllBytes();
+ }
int numberOfInts = mapAsBytes.length / 2;
cid2gid = new Object[numberOfInts][4];
int offset = 0;