Package robocode

Examples of robocode.RobocodeFileOutputStream


        weights.set(i, weights.get(i) * 100);
      }
    }
    File dataFile = robot.getDataFile(DATA_FILE);
    try {
      PrintWriter pw = new PrintWriter(new RobocodeFileOutputStream(
          dataFile));
      for (int i = 0; i < weights.size(); i++) {
        pw.println(new BigDecimal(weights.get(i)).toPlainString());
      }
      pw.close();
View Full Code Here


      incrementedBattles = true;
    }

    PrintStream w = null;
    try {
      w = new PrintStream(new RobocodeFileOutputStream(getDataFile("count.dat")));

      w.println(roundCount);
      w.println(battleCount);

      // PrintStreams don't throw IOExceptions during prints, they simply set a flag.... so check it here.
View Full Code Here

    out.println("Data quota: " + getDataQuotaAvailable());

    byte[] buf = new byte[100000];

    File file = null;
    RobocodeFileOutputStream rfos = null;

    try {
      file = getDataFile("test");
      out.println("Data file: " + file.getCanonicalPath());
      file.delete();

      rfos = new RobocodeFileOutputStream(file);

      for (int i = 0; i < 3; i++) {
        rfos.write(buf);
      }
    } catch (IOException e) {
      e.printStackTrace(out);
    } finally {
      if (rfos != null) {
        try {
          rfos.close();
        } catch (IOException e) {
          e.printStackTrace(out);
        }
      }
      if (file != null) {
View Full Code Here

TOP

Related Classes of robocode.RobocodeFileOutputStream

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.