Skip to content

Commit eeeca9b

Browse files
committed
PDFBOX-5660: optimize, as suggested by Valery Bokov; closes #239
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1928151 13f79535-47bb-0310-9956-ffa450edef68
1 parent 5a8dce5 commit eeeca9b

File tree

1 file changed

+5
-1
lines changed
  • pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common

1 file changed

+5
-1
lines changed

pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDStream.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,16 @@ public COSInputStream createInputStream(DecodeOptions options) throws IOExceptio
199199
*/
200200
public InputStream createInputStream(List<String> stopFilters) throws IOException
201201
{
202+
if (stopFilters == null)
203+
{
204+
stopFilters = Collections.emptyList();
205+
}
202206
InputStream is = stream.createRawInputStream();
203207
List<Filter> someFilters = new ArrayList<>();
204208
List<COSName> filters = getFilters();
205209
for (COSName nextFilter : filters)
206210
{
207-
if (stopFilters != null && stopFilters.contains(nextFilter.getName()))
211+
if (stopFilters.contains(nextFilter.getName()))
208212
{
209213
break;
210214
}

0 commit comments

Comments
 (0)