Hi, all,
This patch adds four missing constructors to java.io.Printstream.
2006-07-16 Thomas Minor [EMAIL PROTECTED]
* java/io/PrintStream.java: Added four missing constructors, for File
and String describing a filename
Thanks,
Thomas
Index: java/io/PrintStream.java
===================================================================
RCS file: /sources/classpath/classpath/java/io/PrintStream.java,v
retrieving revision 1.26
diff -u -r1.26 PrintStream.java
--- java/io/PrintStream.java 13 Jan 2006 07:44:34 -0000 1.26
+++ java/io/PrintStream.java 16 Jul 2006 04:22:20 -0000
@@ -88,6 +88,70 @@
/**
* This method intializes a new <code>PrintStream</code> object to write
+ * to the specified output File.
+ *
+ * @param file The <code>File</code> to write to.
+ * @throws FileNotFoundException if an error occurs while opening the
file
+ */
+ public PrintStream (File file)
+ throws FileNotFoundException
+ {
+
+ this (new FileOutputStream(file), false);
+ }
+
+ /**
+ * This method intializes a new <code>PrintStream</code> object to write
+ * to the specified output File.
+ *
+ * @param file The <code>File</code> to write to.
+ * @param encoding The name of the character encoding to use for this
+ * object.
+ * @throws FileNotFoundException If an error occurs while opening the
file
+ * @throws UnsupportedEncodingException If the charset specified by
+ * <code>encoding</code> is invalid.
+ */
+ public PrintStream (File file, String encoding)
+ throws FileNotFoundException,UnsupportedEncodingException
+ {
+
+ this (new FileOutputStream(file), false, encoding);
+ }
+
+ /**
+ * This method intializes a new <code>PrintStream</code> object to write
+ * to the specified output File.
+ *
+ * @param fileName The name of the <code>File</code> to write to.
+ * @throws FileNotFoundException if an error occurs while opening the
file
+ */
+ public PrintStream (String fileName)
+ throws FileNotFoundException
+ {
+
+ this (new FileOutputStream(new File(fileName)), false);
+ }
+
+ /**
+ * This method intializes a new <code>PrintStream</code> object to write
+ * to the specified output File.
+ *
+ * @param fileName The name of the <code>File</code> to write to.
+ * @param encoding The name of the character encoding to use for this
+ * object.
+ * @throws FileNotFoundException if an error occurs while opening the
file
+ * @throws UnsupportedEncodingException If the charset specified by
+ * <code>encoding</code> is invalid.
+ */
+ public PrintStream (String fileName, String encoding)
+ throws FileNotFoundException,UnsupportedEncodingException
+ {
+
+ this (new FileOutputStream(new File(fileName)), false, encoding);
+ }
+
+ /**
+ * This method intializes a new <code>PrintStream</code> object to write
* to the specified output sink.
*
* @param out The <code>OutputStream</code> to write to.