private void parseControlSequence ( Reader reader ) throws IOException { boolean finishedSequence = false ; StringBuilder parameters = new StringBuilder ( ) ; int character ; while ( ( character = reader . read ( ) ) != - 1 ) { if ( ( character >= ' ' && character <= ' ' ) || ( character >= ' ' && character <= ' ' ) ) { String [ ] array = parameters . toString ( ) . split ( ";" ) ; AnsiControlSequence seq = new AnsiControlSequence ( ( char ) character , array ) ; listener . parsedControlSequence ( seq ) ; finishedSequence = true ; break ; } else { parameters . append ( ( char ) character ) ; } } if ( ! finishedSequence ) { // not an ideal solution if they used the two byte CSI, but it's // easier and cleaner than keeping track of it buffer . append ( ( char ) SINGLE_CSI ) ; buffer . append ( parameters ) ; } }
Parses a control sequence .