Package java.io

Examples of java.io.FileReader


        for(int f = 1; f <= 8; f++) {
            final File file = new File(filename + '.' + f);
            if(!file.exists()) {
                throw new IllegalStateException("File not found: " + filename);
            }
            final BufferedReader reader = new BufferedReader(new FileReader(file));
            for(int j = 0; j < 1000000; j++) {
                String line = reader.readLine();
                dist[i++] = Long.parseLong(line.trim());
            }
            IOUtils.closeQuietly(reader);
View Full Code Here


        for(int f = 1; f <= 8; f++) {
            final File file = new File(filename + '.' + f);
            if(!file.exists()) {
                throw new IllegalStateException("File not found: " + filename);
            }
            final BufferedReader reader = new BufferedReader(new FileReader(file));
            for(int j = 0; j < 1000000; j++) {
                String line = reader.readLine();
                dist[i++] = Long.parseLong(line.trim());
            }
            IOUtils.closeQuietly(reader);
View Full Code Here

        //return new Object[][] { { "/tmp/zipfgen/1000k_zipf0.86_N50k.dat", 16, 16384, 62500, 20d, 100, 8 } };
        //return new Object[][] { { "/tmp/zipfgen/1000k_zipf0.86_N50k.dat", 8, 16384, 125000, 20d, 100, 8 } };
    }

    private static long[][] readDistribution(File file, int nthreads, int round) throws IOException {
        BufferedReader reader = new BufferedReader(new FileReader(file));
        long[][] dist = new long[nthreads][];
        for(int th = 0; th < nthreads; th++) {
            long[] curdist = new long[round];
            dist[th] = curdist;
            for(int i = 0; i < round; i++) {
View Full Code Here

        for(int f = 1; f <= 8; f++) {
            final File file = new File(filename + "." + f);
            if(!file.exists()) {
                throw new IllegalStateException("File not found: " + filename);
            }
            final BufferedReader reader = new BufferedReader(new FileReader(file));
            for(int j = 0; j < 1000000; j++) {
                String line = reader.readLine();
                dist[i++] = Long.parseLong(line.trim());
            }
            IOUtils.closeQuietly(reader);
View Full Code Here

  @SuppressWarnings("unchecked")
  public void load() throws IOException {
    if (_file.exists()) {
      Reader reader = null;
      try {
        reader = new FileReader(_file);
        _beans = (List<T>) _xstream.fromXML(reader);
      } finally {
        if (reader != null) {
          try {
            reader.close();
View Full Code Here

        e.printStackTrace();
      }
      if (commands.hasOption('e')) {
        if (conConsoleInput != null) {
          try {
            Object params[] = {commands.getOptionValue('e'), new_core, new FileReader(commands.getOptionValue('e')), System.out, Boolean.FALSE};
            conConsoleInput.newInstance(params);
          } catch (java.io.FileNotFoundException e) {
            Logger.getLogger("azureus2").error("Script file not found: "+e.toString());
          } catch (Exception e) {
            Logger.getLogger("azureus2").error("Error invocating the script processor: "+e.toString());
View Full Code Here

  }

  public static void open(HexModel dst, File src) throws IOException {
    BufferedReader in;
    try {
      in = new BufferedReader(new FileReader(src));
    } catch (IOException e) {
      throw new IOException(Strings.get("hexFileOpenError"));
    }
    try {
      String header = in.readLine();
View Full Code Here

    if (firstExcept != null) {
      // We'll now try to do it using a reader. This is to work around
      // Logisim versions prior to 2.5.1, when files were not saved using
      // UTF-8 as the encoding (though the XML file reported otherwise).
      try {
        in = new ReaderInputStream(new FileReader(file), "UTF8");
        return loadSub(in, loader);
      } catch (Throwable t) {
        loader.showError(StringUtil.format(
            Strings.get("xmlFormatError"), firstExcept.toString()));
      } finally {
View Full Code Here

        String insertStartMarker =
            Localizer.getMessage("jspc.webinc.insertStart");
        String insertEndMarker =
            Localizer.getMessage("jspc.webinc.insertEnd");

        BufferedReader reader = new BufferedReader(new FileReader(webXml));
        BufferedReader fragmentReader =
            new BufferedReader(new FileReader(webxmlFile));
        PrintWriter writer = new PrintWriter(new FileWriter(webXml2));

        // Insert the <servlet> and <servlet-mapping> declarations
        int pos = -1;
        String line = null;
View Full Code Here

  private void updateJoramAdminCfg(String hostName,
                                   String port)
    throws Exception {
    File file = new File(confDir, JORAMADMIN_CFG);
    FileReader fileReader = new FileReader(file);
    BufferedReader reader = new BufferedReader(fileReader);
    boolean end = false;
    String line;
    StringTokenizer tokenizer;
    String firstToken;
View Full Code Here

TOP

Related Classes of java.io.FileReader

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.