private static @NotNull String loadFile(@NotNull File file, int maxLength) throws IOException {
    try (Reader reader = new InputStreamReader(new FileInputStream(file), Charset.defaultCharset())) {
      int length = (int)Math.min(file.length(), maxLength);
      char[] result = FileUtil.loadText(reader, length);
      if (file.length() > maxLength) {
        return new String(result) + "\n\n+" + (file.length() - maxLength) + " bytes more";
      }
      else {
        return new String(result);
      }
    }
  }
private static @NotNull String loadFile(@NotNull File file, int maxLength)