Package com.intellij.util.text

Examples of com.intellij.util.text.LineReader


  private static String[] readStringsFromFile(String fileName) {
    String[] result = null;
    try {
      InputStream predefined = CfmlLangInfo.class.getResourceAsStream(fileName);
      if (predefined != null) {
        LineReader lineReader = new LineReader(predefined);

        //noinspection unchecked
        List<byte[]> list = lineReader.readLines();
        result = new String[list.size()];
        for (int i = 0; i < list.size(); i++) {
          byte[] bytes = list.get(i);
          final String s = new String(bytes);
          result[i] = s;
View Full Code Here


  }

  @NotNull
  public static String shiftIndentInside(@NotNull String initial, final int i, boolean shiftEmptyLines) throws IOException {
    StringBuilder result = new StringBuilder(initial.length());
    LineReader reader = new LineReader(new ByteArrayInputStream(initial.getBytes()));
    boolean first = true;
    for (byte[] line : reader.readLines()) {
      try {
        if (!first) result.append('\n');
        if (line.length > 0 || shiftEmptyLines) {
          repeatSymbol(result, ' ', i);
        }
View Full Code Here

TOP

Related Classes of com.intellij.util.text.LineReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.