@@ -173,7 +173,7 @@ public PrintWriter(OutputStream out, boolean autoFlush) {
173173 */
174174 public PrintWriter (String fileName ) throws FileNotFoundException {
175175 this (new BufferedWriter (new OutputStreamWriter (
176- newFileOutputStream (new File (fileName )))), false );
176+ new FileOutputStream (new File (fileName )))), false );
177177 }
178178
179179 /**
@@ -211,13 +211,7 @@ public PrintWriter(String fileName) throws FileNotFoundException {
211211 public PrintWriter (String fileName , String csn ) throws FileNotFoundException ,
212212 UnsupportedEncodingException {
213213 this (new BufferedWriter (new OutputStreamWriter (
214- newFileOutputStream (new File (fileName )), csn )), false );
215- }
216-
217- private static OutputStream newFileOutputStream (File file ) {
218- return (OutputStream ) Interface .getInstanceWithParams (
219- "java.io.FileOutputStream" , new Class [] { java .io .File .class },
220- new Object [] { file });
214+ new FileOutputStream (new File (fileName )), csn )), false );
221215 }
222216
223217 /**
@@ -248,7 +242,7 @@ private static OutputStream newFileOutputStream(File file) {
248242 * @since 1.5
249243 */
250244 public PrintWriter (File file ) throws FileNotFoundException {
251- this (new BufferedWriter (new OutputStreamWriter (newFileOutputStream (file ))),
245+ this (new BufferedWriter (new OutputStreamWriter (new FileOutputStream (file ))),
252246 false );
253247 }
254248
@@ -287,7 +281,7 @@ public PrintWriter(File file) throws FileNotFoundException {
287281 */
288282 public PrintWriter (File file , String csn ) throws FileNotFoundException ,
289283 UnsupportedEncodingException {
290- this (new BufferedWriter (new OutputStreamWriter (newFileOutputStream (file ),
284+ this (new BufferedWriter (new OutputStreamWriter (new FileOutputStream (file ),
291285 csn )), false );
292286 }
293287
0 commit comments