}
private void processSubStream(COSStream cosStream) throws IOException
{
List<COSBase> arguments = new ArrayList<COSBase>();
PDFStreamParser parser = new PDFStreamParser(cosStream, forceParsing);
try
{
Iterator<Object> iter = parser.getTokenIterator();
while (iter.hasNext())
{
Object next = iter.next();
if (LOG.isDebugEnabled())
{
LOG.debug("processing substream token: " + next);
}
if (next instanceof COSObject)
{
arguments.add(((COSObject) next).getObject());
}
else if (next instanceof PDFOperator)
{
processOperator((PDFOperator) next, arguments);
arguments = new ArrayList<COSBase>();
}
else
{
arguments.add((COSBase) next);
}
}
}
finally
{
parser.close();
}
}