code: 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;
      }
docs: Process more incoming data.
  
  @param newData
  @return