File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
pdfbox/src/main/java/org/apache/pdfbox/pdmodel Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -193,22 +193,23 @@ public COSDictionary getCOSObject()
193193 */
194194 public Iterator <PDStream > getContentStreams ()
195195 {
196- List <PDStream > streams = new ArrayList <>();
197196 COSBase base = page .getDictionaryObject (COSName .CONTENTS );
198197 if (base instanceof COSStream )
199198 {
200- streams . add (new PDStream ((COSStream ) base ));
199+ return Collections . singletonList (new PDStream ((COSStream ) base )). iterator ( );
201200 }
202201 else if (base instanceof COSArray )
203202 {
204203 COSArray array = (COSArray )base ;
204+ List <PDStream > streams = new ArrayList <>(array .size ());
205205 for (int i = 0 ; i < array .size (); i ++)
206206 {
207207 COSStream stream = (COSStream ) array .getObject (i );
208208 streams .add (new PDStream (stream ));
209209 }
210+ return streams .iterator ();
210211 }
211- return streams . iterator ();
212+ return Collections . emptyIterator ();
212213 }
213214
214215 /**
You can’t perform that action at this time.
0 commit comments