Author: tilman
Date: Sat Feb 15 10:41:13 2025
New Revision: 1923837
URL: http://svn.apache.org/viewvc?rev=1923837&view=rev
Log:
PDFBOX-5957: optimize
Modified:
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
Modified:
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
URL:
http://svn.apache.org/viewvc/pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java?rev=1923837&r1=1923836&r2=1923837&view=diff
==============================================================================
---
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
(original)
+++
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
Sat Feb 15 10:41:13 2025
@@ -358,7 +358,7 @@ public class PDFStreamParser extends Bas
}
// PDFBOX-3742: just assuming that 1-3 non blanks is a PDF
operator isn't enough
- if (endOpIdx != -1 && startOpIdx != -1)
+ if (noBinData && endOpIdx != -1 && startOpIdx != -1)
{
// usually, the operator here is Q, sometimes EMC
(PDFBOX-2376), S (PDFBOX-3784)
s = new String(binCharTestArr, startOpIdx, endOpIdx -
startOpIdx);
@@ -370,7 +370,7 @@ public class PDFStreamParser extends Bas
}
// only if not close to EOF
- if (startOpIdx != -1 && readBytes == MAX_BIN_CHAR_TEST_LENGTH)
+ if (noBinData && startOpIdx != -1 && readBytes ==
MAX_BIN_CHAR_TEST_LENGTH)
{
if (endOpIdx == -1)
{