public boolean process ( final byte [ ] newData ) { if ( newData != null ) { buffer . write ( newData ) ; } boolean done = false ; while ( ! done ) { final int index = buffer . getReaderIndex ( ) ; final State currentState = state ; state = actions [ state . ordinal ( ) ] . apply ( buffer ) ; done = state == currentState && buffer . getReaderIndex ( ) == index ; } return state == State . DONE ; }
Process more incoming data .