Examples of BufferedWriter


Examples of java.io.BufferedWriter

        FileWriter fileWriter = null;
        try {
            reader = new FileReader("profile.txt");
            LineNumberReader r = new LineNumberReader(reader);
            fileWriter = new FileWriter("notCovered.txt");
            BufferedWriter writer = new BufferedWriter(fileWriter);
            int unvisited = 0;
            int unvisitedThrow = 0;
            for (int i = 0; i < maxIndex; i++) {
                String line = r.readLine();
                if (count[i] == 0) {
                    if (!line.endsWith("throw")) {
                        writer.write(line + "\r\n");
                        if (LIST_UNVISITED) {
                            print(line + "\r\n");
                        }
                        unvisited++;
                    } else {
View Full Code Here

Examples of java.io.BufferedWriter

            } else {
                c.addDir(s, recurse);
            }
        }
        try {
            c.data = new BufferedWriter(new FileWriter("profile.txt"));
            c.processAll();
            c.data.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

Examples of java.io.BufferedWriter

            return;
        }
        File f = new File(name);
        File fileNew = new File(name + ".new");
        try {
            writer = new BufferedWriter(new FileWriter(fileNew));
            Reader r = new BufferedReader(new FileReader(f));
            tokenizer = new Tokenizer(r);
            indent = 0;
            try {
                process();
View Full Code Here

Examples of java.io.BufferedWriter

      throws IOException {
  boolean exists = false;
  File summaryFile = new File(outputDir, OVERALL_SUMMARY_FILE); //$NON-NLS-1$
  exists = summaryFile.exists();
    FileWriter fstream = new FileWriter(summaryFile,true);
          BufferedWriter out = new BufferedWriter(fstream);

  if (!exists) {

          try {
              summaryFile.createNewFile();
View Full Code Here

Examples of java.io.BufferedWriter

    throws IOException {
  boolean exists = false;
  File summaryFile = new File(outputDir, OVERALL_SUMMARY_ERROR_FILE); //$NON-NLS-1$
  exists = summaryFile.exists();
  FileWriter fstream = new FileWriter(summaryFile,true);
        BufferedWriter out = new BufferedWriter(fstream);

        if (!exists) {

            try {
          summaryFile.createNewFile();
View Full Code Here

Examples of java.io.BufferedWriter

            list.toArray(procDef);
            traceOperation("start: " + StringUtils.arrayCombine(procDef, ' '));
            process = Runtime.getRuntime().exec(procDef);
            copyInThread(process.getErrorStream(), System.err);
            reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
            writer = new BufferedWriter(new OutputStreamWriter(process.getOutputStream()));
            String line = reader.readLine();
            if (line == null) {
                throw new RuntimeException("No reply from process, command: " + StringUtils.arrayCombine(procDef, ' '));
            } else if (line.startsWith("running")) {
                traceOperation("got reply: " + line);
View Full Code Here

Examples of java.io.BufferedWriter

    }

  private void writeResultSet(File expected, BufferedReader resultReader)
      throws IOException {
    if (WRITE_ACTUAL) {
      BufferedWriter bw = new BufferedWriter(new FileWriter(expected));
      String s = null;
      while ((s = resultReader.readLine()) != null) {
        bw.write(s);
        bw.write("\n"); //$NON-NLS-1$
      }
      bw.close();
    }
  }
View Full Code Here

Examples of java.io.BufferedWriter

     * @param out the output stream or null
     * @return the writer
     */
    public static Writer getBufferedWriter(OutputStream out) {
        try {
            return out == null ? null : new BufferedWriter(new OutputStreamWriter(out, Constants.UTF8));
        } catch (Exception e) {
            // UnsupportedEncodingException
            throw DbException.convert(e);
        }
    }
View Full Code Here

Examples of java.io.BufferedWriter

     * Saves the pattern as a text file
     * @param filename the filename to save under
     */
    public void savePattern(File file) throws IOException
    {
        BufferedWriter out = new BufferedWriter(new FileWriter(file));
        if ((getProperties().size() > 0) || (getTitle() != null)) {
            out.write("#\n");
            if (getTitle() != null) {
                out.write("# ");
                out.write("Title: ");
                out.write(getTitle());
                out.write("\n");
            }
            Iterator<String> iter = getProperties().keySet().iterator();
            while (iter.hasNext()) {
                String key = iter.next();
                if (!key.equals(TITLE)) {
                    String value = getProperty(key);
                    out.write("# ");
                    out.write(key);
                    out.write(": ");
                    out.write(value);
                    out.write("\n");
                }
            }
            out.write("#\n");
            out.write("\n");
        }
        String musicString = getMusicString();
        while (musicString.length() > 0) {
            if ((musicString.length() > 80) && (musicString.indexOf(' ', 80) > -1)) {
                int indexOf80ColumnSpace = musicString.indexOf(' ', 80);
                out.write(musicString.substring(0, indexOf80ColumnSpace));
                out.newLine();
                musicString = musicString.substring(indexOf80ColumnSpace, musicString.length());
            } else {
                out.write(musicString);
                musicString = "";
            }
        }
        out.close();
    }
View Full Code Here

Examples of java.io.BufferedWriter

    // To write the global count of each term
    final OutputBitStream outputGlobCounts = writeGlobCounts ? new OutputBitStream( outputBasename + DiskBasedIndex.GLOBCOUNTS_EXTENSION ) : null;
    // To write the frequency of each term
    final OutputBitStream frequencies = new OutputBitStream( outputBasename + DiskBasedIndex.FREQUENCIES_EXTENSION );
    // To write the new term list
    final PrintWriter termFile = new PrintWriter( new BufferedWriter( new OutputStreamWriter( new FileOutputStream( outputBasename + DiskBasedIndex.TERMS_EXTENSION ), "UTF-8" ), bufferSize ) );
   
    // The current term
    MutableString currTerm;
   
    // Total number of pointers and occurrences
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.