Mercurial > hg > truffle
comparison graal/com.oracle.max.base/src/com/sun/max/io/Files.java @ 4142:bc8527f3071c
Adjust code base to new level of warnings.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sun, 18 Dec 2011 05:24:06 +0100 |
parents | e233f5660da4 |
children |
comparison
equal
deleted
inserted
replaced
4141:04d21be7a24f | 4142:bc8527f3071c |
---|---|
121 } | 121 } |
122 | 122 |
123 /** | 123 /** |
124 * Creates/overwrites a file from a reader. | 124 * Creates/overwrites a file from a reader. |
125 */ | 125 */ |
126 public static void fill(File file, Reader reader, boolean append) throws IOException { | 126 public static void fill(File file, Reader reader) throws IOException { |
127 final BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file)); | 127 final BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file)); |
128 try { | 128 try { |
129 int ch; | 129 int ch; |
130 while ((ch = reader.read()) != -1) { | 130 while ((ch = reader.read()) != -1) { |
131 bufferedWriter.write(ch); | 131 bufferedWriter.write(ch); |
143 } | 143 } |
144 reader.close(); | 144 reader.close(); |
145 } | 145 } |
146 | 146 |
147 public static List<String> readLines(File file) throws IOException { | 147 public static List<String> readLines(File file) throws IOException { |
148 final List<String> lines = new ArrayList<String>(); | 148 final List<String> lines = new ArrayList<>(); |
149 readLines(file, lines); | 149 readLines(file, lines); |
150 return lines; | 150 return lines; |
151 } | 151 } |
152 | 152 |
153 public static char[] toChars(File file) throws IOException { | 153 public static char[] toChars(File file) throws IOException { |