if( c != '<')
{
throw new IOException( "expected='<' actual='" + c + "' " + pdfSource );
}
skipSpaces();
COSDictionary obj = new COSDictionary();
boolean done = false;
while( !done )
{
skipSpaces();
c = (char)pdfSource.peek();
if( c == '>')
{
done = true;
}
else
{
COSName key = parseCOSName();
COSBase value = parseCOSDictionaryValue();
skipSpaces();
if( ((char)pdfSource.peek()) == 'd' )
{
//if the next string is 'def' then we are parsing a cmap stream
//and want to ignore it, otherwise throw an exception.
String potentialDEF = readString();
if( !potentialDEF.equals( DEF ) )
{
pdfSource.unread( potentialDEF.getBytes() );
}
else
{
skipSpaces();
}
}
if( value == null )
{
throw new IOException("Bad Dictionary Declaration " + pdfSource );
}
obj.setItem( key, value );
}
}
char ch = (char)pdfSource.read();
if( ch != '>' )
{