void (@NotNull ProcessEvent event, @NotNull Key outputType) { final boolean isStdout = ProcessOutputType.isStdout(outputType); final StringBuilder lineBuilder = isStdout ? myStdoutLine : myStderrLine; for (String chunk : StringUtil.splitByLinesKeepSeparators(event.getText())) { lineBuilder.append(chunk); if (StringUtil.isLineBreak(lineBuilder.charAt(lineBuilder.length() - 1))) { final String line = lineBuilder.toString(); if (isStdout) { myListener.onStdoutLine(line); } else { myListener.onStderrLine(line); } lineBuilder.setLength(0); } } }