add toString() to SprmBuffer

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1145407 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sergey Vladimirov 2011-07-12 00:38:39 +00:00
parent cb72a45d85
commit b751feb535
1 changed files with 22 additions and 0 deletions

View File

@ -220,4 +220,26 @@ public final class SprmBuffer implements Cloneable
}
addSprm(opcode, operand);
}
@Override
public String toString()
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append( "Sprms (" );
stringBuilder.append( _buf.length );
stringBuilder.append( " byte(s)): " );
for ( SprmIterator iterator = iterator(); iterator.hasNext(); )
{
try
{
stringBuilder.append( iterator.next() );
}
catch ( Exception exc )
{
stringBuilder.append( "error" );
}
stringBuilder.append( "; " );
}
return stringBuilder.toString();
}
}