original.reset();
}
catch (IOException e) {
throw new RuntimeException( e );
}
SerializableTokenStream serOriginal = CopyTokenStream.buildSerializableTokenStream( original );
SerializableTokenStream serCopy = CopyTokenStream.buildSerializableTokenStream( copy );
if ( serOriginal.getStream().size() != serCopy.getStream().size() ) {
return false;
}
for ( int i = 0; i < serOriginal.getStream().size(); i++ ) {
List<AttributeImpl> origToken = serOriginal.getStream().get( i );
List<AttributeImpl> copyToken = serCopy.getStream().get( i );
if ( origToken.size() != copyToken.size() ) {
return false;
}
for ( int j = 0; j < origToken.size(); j++ ) {
AttributeImpl origAttr = origToken.get( j );