Author: tilman
Date: Thu Aug 21 11:26:34 2025
New Revision: 1927945
Log:
PDFBOX-5660: remove unused
Modified:
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
Modified:
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java
==============================================================================
---
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java
Thu Aug 21 10:35:50 2025 (r1927944)
+++
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java
Thu Aug 21 11:26:34 2025 (r1927945)
@@ -1104,51 +1104,6 @@ public abstract class BaseParser
"expected='" + ec + "' actual='" + c + "' at offset " +
source.getPosition());
}
}
-
- /**
- * This will read the next string from the stream up to a certain length.
- *
- * @param length The length to stop reading at.
- *
- * @return The string that was read from the stream of length 0 to length.
- *
- * @throws IOException If there is an error reading from the stream.
- */
- protected String readString( int length ) throws IOException
- {
- skipSpaces();
-
- int c = source.read();
-
- //average string size is around 2 and the normal string buffer size is
- //about 16 so lets save some space.
- StringBuilder buffer = new StringBuilder(length);
- while( !isWhitespace(c) && !isClosing(c) && c != -1 && buffer.length()
< length &&
- c != '[' &&
- c != '<' &&
- c != '(' &&
- c != '/' )
- {
- buffer.append( (char)c );
- c = source.read();
- }
- if (c != -1)
- {
- source.rewind(1);
- }
- return buffer.toString();
- }
-
- /**
- * This will tell if the next character is a closing brace( close of PDF
array ).
- *
- * @param c The character to check against end of line
- * @return true if the next byte is ']', false otherwise.
- */
- protected static boolean isClosing(int c)
- {
- return c == ']';
- }
/**
* This will read bytes until the first end of line marker occurs.
Modified:
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
==============================================================================
---
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
Thu Aug 21 10:35:50 2025 (r1927944)
+++
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
Thu Aug 21 11:26:34 2025 (r1927945)
@@ -428,7 +428,6 @@ public class PDFStreamParser extends Bas
while(
nextChar != -1 && // EOF
!isWhitespace(nextChar) &&
- !isClosing(nextChar) &&
nextChar != '[' &&
nextChar != '<' &&
nextChar != '(' &&