{
int count = 0;
getStandardOutput().write(ARRAY_OPEN);
for (Iterator i = obj.iterator(); i.hasNext();)
{
COSBase current = (COSBase) i.next();
if( current instanceof COSDictionary )
{
addObjectToWrite( current );
writeReference( current );
}
else if( current instanceof COSObject )
{
COSBase subValue = ((COSObject)current).getObject();
if( subValue instanceof COSDictionary || subValue == null )
{
addObjectToWrite( current );
writeReference( current );
}
else
{
subValue.accept( this );
}
}
else if( current == null )
{
COSNull.NULL.accept( this );