} else if (octet == '\r') {
buffer[i++] = (byte) octet;
octet = readInput();
if (octet == '\n') {
if (i >= buffer.length)
throw new MaxLineLimitException(
"Input line length is too long!");
buffer[i++] = (byte) octet;
return i;
} else {
logInvalidLineEnding();
pushBack(octet);
return i;
}
} else if (octet == '\n') {
logInvalidLineEnding();
buffer[i++] = (byte) octet;
return i;
} else {
buffer[i++] = (byte) octet;
}
if (i >= buffer.length)
throw new MaxLineLimitException(
"Input line length is too long!");
}
}