protected String stripNewline(String str) {
    int indexOfR = str.indexOf("\r");
    if (indexOfR != -1) {
      return str.substring(0, indexOfR);
    }
    return str;
  }
A buffer to read and decode the first line.
geode-memcached/src/main/java/org/apache/geode/internal/memcached/commands/AbstractCommand.java