private void replaceCommandLine ( String replacement ) { int currentCLSize = commandLineBuffer . size ( ) ; commandLineBuffer = new ByteArrayOutputStream ( ) ; for ( int x = 0 ; x < replacement . length ( ) ; x ++ ) { commandLineBuffer . write ( replacement . charAt ( x ) ) ; } String replaceString = ' ' + promptStr ; for ( int x = 0 ; x <= currentCLSize ; x ++ ) { replaceString += ' ' ; } replaceString += ' ' + promptStr + replacement ; ps . print ( replaceString ) ; }
Replaces the current command line on the telnet client with another one .