question: public void loadWorkspaceContents ( InputStream is ) throws BlocklyParserException { List < Block > newBlocks = BlocklyXmlHelper . loadFromXml ( is , mBlockFactory , mStats ) ; SimpleArrayMap < String , String > varsMap = mVariableNameManager . getUsedNames ( ) ; String [ ] vars = new String [ varsMap . size ( ) ] ; for ( int i = 0 ; i < varsMap . size ( ) ; i ++ ) { vars [ i ] = varsMap . keyAt ( i ) ; } mController . resetWorkspace ( ) ; for ( int i = 0 ; i < vars . length ; i ++ ) { mController . addVariable ( vars [ i ] ) ; } mRootBlocks . addAll ( newBlocks ) ; for ( int i = 0 ; i < mRootBlocks . size ( ) ; i ++ ) { mStats . collectStats ( mRootBlocks . get ( i ) , true ) ; } }
target:  Reads the workspace in from a XML stream. This will clear the workspace and replace it with the contents of the xml.