Commit 7b9e6b31 authored by Louis  Jimenez-Hernandez's avatar Louis Jimenez-Hernandez
Browse files

Change to FileWriter

parent 0a979dbb
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ public class readFile {
     * vertices or points in a 3D space.
     * <p>
     * This method creates or overwrites a file named according to the {@code filename} parameter. It uses
     * a {@link BufferedWriter} to efficiently write lines to the file. Each line represents a collection of
     * a {@link FileWriter} to efficiently write lines to the file. Each line represents a collection of
     * three coordinate points, each point consisting of x, y, and z coordinates generated randomly within a
     * range of 0 to 30 (exclusive).
     *
@@ -206,11 +206,11 @@ public class readFile {
     */
    public static void randFileGenerator(String filename) throws IOException {
        Random random = new Random();
        try (BufferedWriter writer = new BufferedWriter(new FileWriter(filename))) {
        try (FileWriter writer = new FileWriter(filename)) {
                for (int i = 0; i < 15000; i++) {
                    String face = makeLine(random);
                    writer.write(face);
                writer.newLine();
                    writer.write(System.lineSeparator());
                }
            }