private void select()

in java/com/google/devtools/bazel/e4b/command/SelectOutputStream.java [70:85]


  private void select(boolean appendNewLine) throws UnsupportedEncodingException, IOException {
    String line = null;
    if (selector != null) {
      line = selector.apply(stream.toString(StandardCharsets.UTF_8.name()));
    }

    if (line != null) {
      lines.add(line);
    } else if (output != null) {
      if (appendNewLine) {
        stream.write('\n');
      }
      output.write(stream.toByteArray());
    }
    stream.reset();
  }