@NotNull public static String loadText(@NotNull VirtualFile file, int length) throws IOException { InputStreamReader reader = new InputStreamReader(file.getInputStream(), file.getCharset()); try { return StringFactory.createShared(FileUtil.loadText(reader, length)); } finally { reader.close(); } }