in src/main/java/com/univocity/parsers/common/input/AbstractCharInputReader.java [430:470]
public final String getString(char ch, char stop, boolean trim, String nullValue, int maxLength) {
if (i == 0) {
return null;
}
int i = this.i;
for (; ch != stop; ch = buffer[i++]) {
if (i >= length) {
return null;
}
if (lineSeparator1 == ch && (lineSeparator2 == '\0' || lineSeparator2 == buffer[i])) {
break;
}
}
int pos = this.i - 1;
int len = i - this.i;
if (len > maxLength) { //validating before trailing whitespace handling so this behaves as an appender.
return null;
}
this.i = i - 1;
if (trim) {
i = i - 2;
while (buffer[i] <= ' ' && whitespaceRangeStart < buffer[i]) {
len--;
i--;
}
}
String out;
if (len <= 0) {
out = nullValue;
} else {
out = new String(buffer, pos, len);
}
nextChar();
return out;
}